Bug 135350 - Weird direction & alignment issues in new documents when switching to RTL
Summary: Weird direction & alignment issues in new documents when switching to RTL
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer Web (show other bugs)
Version:
(earliest affected)
7.0.0.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTL-CTL
  Show dependency treegraph
 
Reported: 2020-07-31 18:18 UTC by Eyal Rozenberg
Modified: 2020-08-04 21:00 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2020-07-31 18:18:18 UTC
Reproduction instructions:

1. Create a new (Writer) document
2. Type a word in an RTL language, e.g.  مرحبا or שלום .
3. Type a period. It will appear to the right of the word (which is as expected for LTR)
4. Set the Default Page Style to RTL (if it isn't that already).

This sets the paragraph direction RTL, since it is inheriting from the page style; and the period now shows to the _left_ of the word we've typed.

At this point we observe two issues:

* The paragraph alignment is Left. It shouldn't be Left, it should switch to Right when its direction switches. (Of course, it should actually be neither Left nor Right but Start, but we don't have that option for alignment at the moment; see bug 131192). So the text is at the left edge of the page, instead of moving to the right, as it should have with the direction switch

* The direction indicator has not switched to RTL, although if I switch from the Writer window to another window, then back, the direction indicator has switched to RTL (but the alignment has not).

5. Insert a footnote
6. Type again the same word and a period.

The footnote paragraph is also RTL-directed, left-aligned: The period appears after word we've typed.

I am 95% certain this is a regression. Thanks to Safeer from the RTL Telegram group for reporting this.

Experienced with:

Version: 7.0.0.0.beta2
Build ID: 1c213561a365b5666167321de68c9977500c9612
CPU threads: 4; OS: Linux 5.2; UI render: default; VCL: gtk3
Locale: en-US (en_IL); UI: en-US
Comment 1 Eyal Rozenberg 2020-07-31 18:21:10 UTC
I am now less sure this is a regression...

Seeing this with

Version: 6.4.0.3
Build ID: b0a288ab3d2d4774cb44b62f04d5d28733ac6df8
CPU threads: 4; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: he-IL (en_IL); UI-Language: en-US

except I started with an RTL default page direction, switched it to LTR, and got a right-aligned LTR paragraph with right-aligned LTR footnotes.
Comment 2 eladhen2 2020-08-04 14:33:33 UTC
Confirmed on LibreOffice 7.0.0.3 8061b3e9204bef6b321a21033174034a5e2ea88e
Comment 3 Eyal Rozenberg 2020-08-04 20:59:17 UTC
Let me clarify the reproduction instructions in case your default page style (and paragraph style) is RTL:

1. Create a new Writer document (where the default paragraph style is RTL, or alternatively, it's Inherit, and the default page style is RTL); the cursor should be at the right edge at the first line at the top of the page.
2. Type a word in an LTR language, e.g. "hello" (no quotes).
3. Type a period. It will appear to the left of the word (which is as expected for an RTL paragraph).
4. Set the Default Page Style to LTR, or if the default paragraph style is not Inherit, set it to LTR.

This sets the paragraph direction LTR; and the period now shows to the _left_ of the word we've typed.

At this point we observe two issues:

* The paragraph alignment is Right. It shouldn't be Right, it should switch to Left when its direction switches. (Of course, it should actually be neither Left nor Right but Start, but we don't have that option for alignment at the moment; see bug 131192). So the text is at the right edge of the page, instead of moving to the left, as it should have with the direction switch.

* The direction indicator has not switched to LTR, although if you switch from the Writer window to another window, then back, the direction indicator may switch to LTR (while the alignment does not).

5. Insert a footnote
6. Type again the same word and a period ("hello.")

The footnote paragraph is also LTR-directed, Right-aligned: The period appears after the word we've typed - to its right; but the entire footnote is on the right side of the page.