Bug 143496 - misplaced smartTags with XRangeBasedSmartTagRecognizer / commitTextRangeMarkup
Summary: misplaced smartTags with XRangeBasedSmartTagRecognizer / commitTextRangeMarkup
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-22 12:19 UTC by K Antal
Modified: 2024-05-11 03:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
example demonstrating the problem (49.81 KB, application/zip)
2021-07-22 12:19 UTC, K Antal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description K Antal 2021-07-22 12:19:43 UTC
Created attachment 173773 [details]
example demonstrating the problem

* Problem:

- context: using XRangeBasedSmartTagRecognizer with 
           XTextMarkup.commitTextRangeMarkup (in java)

- XRangeBasedSmartTagRecognizer.recognizeTextRange 
  receives an XTextRange
- selecting a subrange from this XTextRange containing the part to be tagged
  and passing it to xTextMarkup.commitTextRangeMarkup
  results in wrong part of the text to tagged
  if a "Bibliography Entry" precedes it.

Files (in attachment.zip):

compile.sh : bash script to compile, pack into oxt
             and install the oxt into Libreoffice.
             Needs to be adjusted at the top (LO_PROGRAM_DIR, JAVAC, JAR, ZIP)

Makefile : mostly calls compile.sh (except for clean and distclean)

src/ : sources
      src/my/smarttags/Recognizer.java : recognizeTextRange() is the
                                         relevant part

sample.odt : Demonstrating the problem.

lo7 lo7-debug : shell scripts to run development Libreoffice.
             They need to be adjusted at the top (LO_PROGRAM_DIR)

Directories created by compile.sh:

tmp/ : used by compile.sh

out/ : generated files. The oxt file is at out/bin/mySmartTags.oxt

* Reproduce:

- (1a) Either build and install:

  - Assumes unix-like environment with javac, jar, zip, bash, egrep, sed,
                                       mkdir, rm, make
  - Edit the top of compile.sh: LO_PROGRAM_DIR, JAVAC, JAR, ZIP
  - make # It will also install the package using LO_PROGRAM_DIR/unopkg

- (1b): Or use prebuilt version:

  - unopkg add out/bin/mySmartTags.oxt

- (2) Open sample.odt in libreoffice with stdout/stderr visible on a console

  - Each "Hello" should be marked.
  - In row (1) they are
  - In row (3) the tags are mislocated.
  - On the console:
     - helloR() reports the length and content of the XTextRange received
     - marking() reports the content of the XTextRange passed to 
       commitTextRangeMarkup

* Libreoffice versions:

- development:
   Version: 7.2.0.0.alpha0+ / LibreOffice Community
   Build ID: 1c006cec7ab0bb13160de55ea8771dc1e7b314d9
   CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
   Locale: en-US (en_US.UTF8); UI: en-US
   Calc: threaded

- Version: 6.4.7.2 Build ID: 1:6.4.7-0ubuntu0.20.04.1
  CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
  Locale: hu-HU (en_US.UTF8); UI-Language: en-US
  Calc: threaded
Comment 1 Buovjaga 2022-05-11 14:47:42 UTC
Reproduced

Arch Linux 64-bit
Version: 7.3.3.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
7.3.3-2
Calc: threaded
Comment 2 QA Administrators 2024-05-11 03:16:52 UTC
Dear K Antal,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug