Bug 125455 - Setting LTR direction in mixed-RTL document gets reverted on reopen (per Comment 10)
Summary: Setting LTR direction in mixed-RTL document gets reverted on reopen (per Comm...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: confirmed:6.2.3.2:ubuntu target:7.1.0...
Keywords: implementationError
Depends on:
Blocks: RTL-CTL Section
  Show dependency treegraph
 
Reported: 2019-05-23 08:18 UTC by Iqtedar
Modified: 2020-06-04 23:12 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
An attempt to recreate the issue plus screenshots for Bug 125455 (205.52 KB, application/vnd.oasis.opendocument.text)
2019-06-09 09:44 UTC, Iqtedar
Details
A shortened version of the original file showing the 4 issues (288.89 KB, application/vnd.oasis.opendocument.text)
2019-11-23 10:01 UTC, Iqtedar
Details
A shortened version of ODT showing single LTR columns issue (75.95 KB, application/vnd.oasis.opendocument.text)
2020-01-09 13:27 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iqtedar 2019-05-23 08:18:15 UTC
Description:
Contents in sections tend to get distorted after reopening the file, which makes it necessary to fix them every time the file is opened. A numbered list that got reversed and misaligned was corrected by readjusting the column, index and paragraph indent settings, and disappeared text was made to appear again by clicking on a visible portion and using the arrow keys. Some inserted figures in the main body (not in a sectioned portion) also tend to disappear but not all, and you need to press return and backsapce to make them reappear. This problem is not specific to this version of LibreOffice. It has been present in previous versions as well, but I expected it would have been resolved by now.

Steps to Reproduce:
1. Create a section within a word processing document.
2. Create formatted content in that section
3. Save and close the file.
4. Reopen the file.

Actual Results:
Some or other formatting gets distorted, or the content is not visible at all upon reopening the file. Outside of sections, this only happens to some inserted figures sometimes (not always).

Expected Results:
The content should remain visible and the formatting should be preserved.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Comment 1 Iqtedar 2019-05-23 08:20:33 UTC
The issue is not specific to the current version of LibreOffice being used (6.2.3.2). It was also happening in previous versions.
Comment 2 Dieter 2019-06-07 09:09:06 UTC Comment hidden (obsolete)
Comment 3 Iqtedar 2019-06-09 09:44:07 UTC
Created attachment 152061 [details]
An attempt to recreate the issue plus screenshots for Bug 125455

I tried to recreate the issue in a new simple file (page 1 of attached), but everything appears as normal when reopening it. It could therefore be due to the extra complexity of the original file (165 pages with mixed LTR and RTL content), but it is not peculiar to that one file, as I've experienced the same on other files as well.

When the text in the first 2-column section disappears (of original file; see exhibits 1 and 2 on page 2 of attached file), the solution is simple. I just click just above (outside) the section, then press return and backspace. In another section, the content inside it is partially displayed and I have to click inside that section and the text reappears when pressing the down arrow key.

In a section with a numbered index displayed, the procedure is longer (see exhibits 2 and 3 on page 3). I have to:
1. Select All inside the section
2. Go to Format Columns
3. Change the text direction back to LTR (it reverts to 'Use subordinate' automatically when the file is closed.
4. Sometimes fix the paragraph indents and indexing again as well.

A related issue - Some inserted figures also disappear and are made to reappear by the first method above, but this particular issue happens within a normal (non-sectioned) area and affects interoperability - e.g. if I copy a diagram created in LibreOffice Draw, paste it into a Writer document, and save as doc/docx for clients, they don't see these inserted figures. The workaround is to turn them into images which solves the problem most (not all) of the time.
Comment 4 Dieter 2019-10-20 05:42:37 UTC Comment hidden (obsolete)
Comment 5 Iqtedar 2019-11-23 08:48:15 UTC Comment hidden (obsolete)
Comment 6 Dieter 2019-11-23 09:36:43 UTC Comment hidden (obsolete)
Comment 7 Iqtedar 2019-11-23 10:01:16 UTC
Created attachment 156061 [details]
A shortened version of the original file showing the 4 issues

Attached is a shortened version of the original file with an issue at 4 places:
1. In a sub-TOC - direction changes from LTR to RTL
2. An inserted image that disappears
3-4. The beginning (or latter) portion of the glossary text inside a created section disappears.

For 1, the fix is to reformat the column and change the direction back; for 2-4, the fix is to place the cursor prior to the disappeared portion (or at the end), press return, then backspace, and it reappears.
Comment 8 QA Administrators 2019-11-24 03:37:47 UTC Comment hidden (obsolete)
Comment 9 Timur 2020-01-09 13:27:03 UTC
Created attachment 157038 [details]
A shortened version of ODT showing single LTR columns issue
Comment 10 Timur 2020-01-09 13:31:47 UTC
Iqtedar, you wrote too extensive bug report. 
Basic rules are: one bug per report (regardless if the same document) and search before reporting. Let's focus on 1st issue (and if someone fixes it, s/he may fix all).

Bug focus is RTL in sub-TOC "English Translations" with columns - direction changes from LTR to RTL.
I reproduce with master 6.5+ in Windows.

Steps:
1. open ODT attachment 157038 [details]
2. see that sub-TOC "English Translations" wrong columns order
3. Format-Columns, Text direction: see that's "use superodinate object setting" and set LTR and see it's OK
4. save, close and reopen, see columns and Format-Columns

Experienced: change was not accepted, still "use superodinate" 
Expected: columns are OK, LTR is set
Comment 11 Justin L 2020-03-18 13:03:39 UTC
I'm not sure how you managed to create this document. It contains columns (which implies a section) but there is no section to manage. That ultimately seems to be the problem.

If you explicitly but the columns in a section, then it all seems to work.
Comment 12 Commit Notification 2020-06-04 14:38:58 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/08c414f908353c38b93491ee1b6405c6489468d3

xmloff: ODF export: fix crash on tdf125455-2.odt

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2020-06-04 23:12:36 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/69eb1bb950d09c8edfc78f980c21645c88ac408e

xmloff: ODF export: fix crash on tdf125455-2.odt

It will be available in 7.0.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.