Bug 55142 - Character position doesn't match caret position in justified text
Summary: Character position doesn't match caret position in justified text
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Mac OS X (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:3.7.0 target:3.6.3 target:4.3.0
Keywords: patch
: 44008 69879 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-20 12:18 UTC by Sergey Farbotka
Modified: 2016-11-11 22:33 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshots before/after patching and patch (81.42 KB, application/zip)
2012-09-20 12:18 UTC, Sergey Farbotka
Details
The same attachment, this time hopefully detected as ZIP file (81.42 KB, application/x-zip)
2012-09-20 16:12 UTC, Roman Eisele
Details
New patch (686 bytes, patch)
2012-10-02 15:17 UTC, Sergey Farbotka
Details
LibreOffice 4.2.5.1 left justified text (1.00 MB, image/jpeg)
2014-06-05 07:53 UTC, Italo Vignoli
Details
LibreOffice 4.3 Beta 1 left justified text (1.08 MB, image/jpeg)
2014-06-05 07:56 UTC, Italo Vignoli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Farbotka 2012-09-20 12:18:05 UTC
Created attachment 67434 [details]
Screenshots before/after patching and patch

1. In Writer/Calc (Mac OS only) open a new document and enter a few lines of arbitrary text, including long words (to make effect more obvious). 
2. Format the paragraph as "justified"
3. Add some more text in this paragraph with preferably long words.
4. Move caret in changed line either with mouse or with keyboard. 

Result: Caret does not match letter boundaries. Makes editing difficult.

You can see incorrect caret position in screenshot-1.png
Pay attention to location of red wavy lines of spell checker. Characters should correspond to these lines.

This bug has migrated from OpenOffice
https://issues.apache.org/ooo/show_bug.cgi?id=102903

PATCH IS ATTACHED! (libreoffice-core-3.6.1.2_fix.patch)
screenshot-2.png is taken from patched version of libreoffice-3.6.1.2
Comment 1 Roman Eisele 2012-09-20 16:12:32 UTC
Created attachment 67458 [details]
The same attachment, this time hopefully detected as ZIP file



The attachment of comment #0 was errorneously detected as text/plain, therefore I attempt to attach it again, this time as binary file.
Comment 2 Roman Eisele 2012-09-20 16:16:28 UTC
Thank you for your bug report!

Bug is REPRODUCIBLE with every version of LibreOffice I know. So setting Status to NEW, and Version to the first available (this is our usual way to proceed with bugs inherited from OOo).

But I can’s say anything about the patch, of course ;-)
Comment 3 Roman Eisele 2012-09-20 16:18:25 UTC
@Thorsten Behrens:

To this bug report (for Mac OS X only) there is attached a patch. Could you please review it, forward it to the dev mail list / to gerrit, or whatever may be appropriate?

Thank you very much!
Comment 4 Thorsten Behrens (CIB) 2012-09-21 11:38:42 UTC
(In reply to comment #0)
> PATCH IS ATTACHED! (libreoffice-core-3.6.1.2_fix.patch)
> screenshot-2.png is taken from patched version of libreoffice-3.6.1.2
>
Nice fix, I'll look into it now - meanwhile, we'd need a license statement from you, to incorporate this into LibreOffice - could you mail something along the lines of 

 http://lists.freedesktop.org/archives/libreoffice/2012-April/029320.html

to libreoffice@lists.freedesktop.org? Thanks a lot!
Comment 5 Sergey Farbotka 2012-09-21 12:14:04 UTC
(In reply to comment #4)
> Nice fix, I'll look into it now - meanwhile, we'd need a license statement from
> you, to incorporate this into LibreOffice - could you mail something along the
> lines of 
> 
>  http://lists.freedesktop.org/archives/libreoffice/2012-April/029320.html
> 
> to libreoffice@lists.freedesktop.org? Thanks a lot!

No problem :)

http://lists.freedesktop.org/archives/libreoffice/2012-September/038724.html
Comment 6 Thorsten Behrens (CIB) 2012-09-21 12:17:28 UTC
(In reply to comment #5)
> No problem :)
> 
> http://lists.freedesktop.org/archives/libreoffice/2012-September/038724.html
>
Excellent, and patch is fine - applied & pushed. Thanks a lot!
Comment 7 Not Assigned 2012-09-21 12:18:49 UTC
Sergey Farbotka committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f1651ee579bf38a49b839dbcb28ac38c0163a3d2

Fix fdo#55142 - wrong character pos calculation on mac.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Roman Eisele 2012-09-21 12:24:06 UTC
Thank you, Sergey, again for the patch,
and you, Thorsten, for the review!

Question:
Can we get this for 3.6.x, too? Given that Sergey developed his patch with a “patched version of libreoffice-3.6.1.2”, it should be easy to backport this, shouldn’t it? :-)

Thank you again!
Comment 9 Sergey Farbotka 2012-09-21 21:27:17 UTC
Files to be patched are equal in all 3.6.x branches (libreoffice-3-6, libreoffice-3-6-0, libreoffice-3-6-1, libreoffice-3-6-2). So you can easily use this patch for all 3.6.x versions.
Comment 10 Roman Eisele 2012-09-25 18:24:25 UTC
*** Bug 44008 has been marked as a duplicate of this bug. ***
Comment 11 Roman Eisele 2012-09-26 09:33:20 UTC
I have tested the latest master build to verify the fix. Mixed results:
* On the one hand, the patch does what it should do -- the caret does match
  the character position in much more cases now, fine!
* On the other hand, I fear that the patch has introduced one or two
  regressions. For these, please see bug 55350 - “Letter spacing and "expand single word" do not work anymore”.
Comment 12 Roman Eisele 2012-09-26 09:34:21 UTC
NB: Until bug 55350 is analysed, please do NOT backport this patch. Thanks!
Comment 13 Thorsten Behrens (CIB) 2012-09-28 11:03:22 UTC
(In reply to comment #11)
> * On the other hand, I fear that the patch has introduced one or two
>   regressions. For these, please see bug 55350 - “Letter spacing and "expand
>   single word" do not work anymore”.
>
Sergey, any chance you could look into the above problem?
Comment 14 Sergey Farbotka 2012-10-02 15:17:27 UTC
Created attachment 67999 [details]
New patch

Confirm that my fix triggered bug 55350.
I just posted patch for bug 55350 that also fixes this bug in master branch.
This attachment is patch for all 3.6.x branches.
Comment 15 Not Assigned 2012-10-02 15:40:15 UTC
Thorsten Behrens committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d6418f680b8861dfea1ce1be6e9358b23cfb3064

Revert "Fix fdo#55142 - wrong character pos calculation on mac."



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Thorsten Behrens (CIB) 2012-10-02 15:40:28 UTC
(In reply to comment #14)
> Created attachment 67999 [details] [review]
>
Thanks a lot, reverted old, applied this one!
Comment 17 Not Assigned 2012-10-02 15:40:34 UTC
Sergey Farbotka committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=da9a26f5f49ea56422bb791d4f96725283d3e8c6

Fix fdo#55142 - use proper output offsets.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 Not Assigned 2012-10-10 10:44:03 UTC
Sergey Farbotka committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6dd3e7afecd703e8f1435a63e7dad37a4f07b800&g=libreoffice-3-6

Fix fdo#55142 - use proper output offsets.


It will be available in LibreOffice 3.6.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 19 Roman Eisele 2012-10-23 16:44:31 UTC
VERIFIED as FIXED on Mac OS X 10.6.8 (Intel) both with
  LibreOffice/LOdev 3.6.4.0+ daily build
  (Bbuild ID: b3a49f9; pull time: 2012-10-22 13:06:54)
and
  LOdev 3.7.0.0.alpha0+ daily build
  (build ID: 370m0(Build:0); pull time: 2012-10-21 10:01:47)

As far as some quick tests can show, the caret position is much more precise now than in 3.5.7.1 or 3.6.2.2. I did not find any negative side-effects of the new patch.

@ Sergey Farbotka:
So, your little patch has made a big progress, making editing justified text much easier on Mac OS X. Thank you very much!
Comment 20 Sebastian Feiler 2014-02-28 16:27:25 UTC
On MacOS in Version 4.1 and 4.2 (I am currently running 4.2.1.1. release), this problem re-appears and seems to persist. I can still reproduce the bug. Has it been re-introduced somehow?

Pleas excuse me if this is an inappropriate place, I am new to bug reporting. If there is a more appropriate way to report this, could you please kindly point me in the appropriate direction? Thank you!
Comment 21 Commit Notification 2014-03-14 04:48:51 UTC
Herbert Dürr committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eb4fb12fdbe14b929cf8fe5d5785fcfae8d96fa4

fdo#55142 CoreText handling of trailing whitespace in justified mode



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 22 Adolfo Jayme 2014-03-25 21:28:03 UTC
*** Bug 69879 has been marked as a duplicate of this bug. ***
Comment 23 Italo Vignoli 2014-06-05 07:53:50 UTC
Created attachment 100446 [details]
LibreOffice 4.2.5.1 left justified text

LibreOffice 4.2.5.1 left justified text showing non printing characters at the right position.
Comment 24 Italo Vignoli 2014-06-05 07:56:30 UTC
Created attachment 100448 [details]
LibreOffice 4.3 Beta 1 left justified text

LibreOffice 4.3 Beta 1 left justified text showing all non printing characters in the wrong position (most of them are under a word).
Comment 25 QA Administrators 2015-06-08 14:42:22 UTC Comment hidden (obsolete)
Comment 26 QA Administrators 2016-09-20 10:01:31 UTC Comment hidden (obsolete)
Comment 27 eisa01 2016-11-11 22:33:50 UTC
I can not reproduce this

Version: 5.3.0.0.alpha1+
Build ID: 17e9dc436bc6ad8d3a5bbde15d4d47262650aa2c
CPU Threads: 2; OS Version: Mac OS X 10.12; UI Render: default; Layout Engine: new; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-11-06_01:25:01
Locale: en-US (en_NO.UTF-8); Calc: group