Bug 42561 - Changing a long paragraph direction reverses the letters
Summary: Changing a long paragraph direction reverses the letters
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.4.3 release
Hardware: All Linux (All)
: lowest minor
Assignee: Not Assigned
Depends on: 30668
  Show dependency treegraph
Reported: 2011-11-03 08:57 UTC by Munzir Taha
Modified: 2013-05-01 19:03 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:

A document that shows the letters get reversed and by omitting the last characters things go back to normal (9.83 KB, application/vnd.oasis.opendocument.text)
2011-11-03 08:57 UTC, Munzir Taha

Note You need to log in before you can comment on or make changes to this bug.
Description Munzir Taha 2011-11-03 08:57:22 UTC
Created attachment 53117 [details]
A document that shows the letters get reversed and by omitting the last characters things go back to normal

Pasting a long paragraph (with no new lines) that span many pages, would stop at around page 11 on my laptop (but differs from computer to another). The problem is not just the limit should be more but the serious problem is letters get reversed. We first encounter this bug while typing Arabic text in an LTR mode. Then I tested with English in RTL mode.

To reproduce the bug:
1. I opened a blank document.
2. Changed the direction to RTL (Ctrl+Shift+D)
3. typed some English paragraph and copied and pasted it many times
4. at around page 11 or 28 (depending on may be the font type, size, language and resources the pasting stopped and the English letters get reversed e.g Munzir Taha showed as ahaT riznuM

Though the bug is not a general use case but it indicates a programming error somewhere that may even help resolving other unknown issues.
Comment 1 Munzir Taha 2011-12-29 07:35:40 UTC
If any one find it difficult to reproduce the way I mentioned, just open the attachment and you would see the text in reverse, then delete some lines, and you would see it normal
Comment 2 Cor Nouws 2011-12-29 07:48:06 UTC
Hi Munzir,

Thanks for reporting.
Though I never use RTL, thanks to your clear description it was easy to confirm this one.
For the record: on Ubuntu in 3.5.0 beta2
Comment 3 Julien Nabet 2011-12-29 07:58:09 UTC
If I open the document, I don't see any writings, perhaps because I don't have a required font.
But in both cases, 3.5 branch or master (future 3.6), I see these errors on console (repeated several times) :
warn:legacy.osl:30592:1:/home/julien/compile-libreoffice/libo/tools/source/string/strucvt.cxx:144: Overflowing rtl::OUString -> UniString cut to zero length
warn:legacy.osl:30592:1:/home/julien/compile-libreoffice/libo/sw/source/core/text/itrform2.cxx:384: SwTxtFormatter::BuildPortions: bad text length in info

I don't know if it's linked or not.
Comment 4 Christian Lohmaier 2011-12-29 08:04:21 UTC
can confirm, although the chances to encounter this bug is very minor.

There is a well known limit of 64k characters per paragraph, and as you need to reach this limit to trigger the bug, the 64k limit is the real issue here. That the text gets reversed probably is a side-effect.

Honestly I doubt that this problem gets fixed by itself. It is just too unlikely to affect people. Thus I set the importance to "lowest".
When the 64k problem is fixed, this one will vanish too...
Comment 5 A (Andy) 2013-04-30 22:07:39 UTC
for me not reproducible with LO (Win7 Home, 64bit) as described in Comment 1

@Munzir: Does this issue still persist for you with the latest release fo LO?
Comment 6 Munzir Taha 2013-05-01 18:55:12 UTC
I confirm this bug is fixed in 4.0.2. Thanks "A" for pointing that out.
Comment 7 Julien Nabet 2013-05-01 19:03:15 UTC
Following A and Munzir comments, I put this as WFM. Thank you for your feedback both of you!