[Libreoffice-bugs] [Bug 143496] New: misplaced smartTags with XRangeBasedSmartTagRecognizer / commitTextRangeMarkup

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jul 22 12:19:43 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=143496

            Bug ID: 143496
           Summary: misplaced smartTags with XRangeBasedSmartTagRecognizer
                    / commitTextRangeMarkup
           Product: LibreOffice
           Version: 7.2.0.0 alpha1+
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: sdk
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: antalk2 at gmail.com

Created attachment 173773
  --> https://bugs.documentfoundation.org/attachment.cgi?id=173773&action=edit
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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210722/b8a36641/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list