<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - misplaced smartTags with XRangeBasedSmartTagRecognizer / commitTextRangeMarkup"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=143496">143496</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>misplaced smartTags with XRangeBasedSmartTagRecognizer / commitTextRangeMarkup
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>7.2.0.0 alpha1+
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>sdk
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>antalk2@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="https://bugs.documentfoundation.org/attachment.cgi?id=173773" name="attach_173773" title="example demonstrating the problem">attachment 173773</a> <a href="https://bugs.documentfoundation.org/attachment.cgi?id=173773&action=edit" title="example demonstrating the problem">[details]</a></span>
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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>