Description: In Writer, when writing a new RTL document with locale defined as Hebrew the document behaves as though it's in RTL, but checking the Default Style "Text direction" is defined as "Use superordinate object settings". If you save the document as docx and reopen it you will find that the Default Style's "Text direction" is defined as "Left-to-right (LTR)". Applying Styles in the document now are LTR. Steps to Reproduce: 1. Define your locale as Hebrew in Tools > Options > Language Settings > Languages 2. Restart Libreoffice Writer. 3. Write a document using styles (heading 1, Text Body etc.). Notice that the text is RTL (as it should be in this Locale). 4. Go to Styles > Styles and formatting and right click Default Style, selecting Modify... > Alignment. Notice that Properties > Text direction is set by default to "Use superordinate object settings" 5. Save the file as a docx file. 6. Close LO writer and reopen the saved docx file. 7. Write a line and apply a style (heading 1, Text Body etc.). Actual Results: The applied styles' Text direction is "Left-to-right (LTR)". Expected Results: *The same RTL styles from while writing the file would be applied. Reproducible: Always User Profile Reset: No Additional Info: Workaround *You can manually go to Styles > Styles and formatting and right click Default style, selecting Modify... > Alignment > Properties > Text direction and change it to "Right-to-left (RTL)" before you save. I'm using Version 6.0.2.1 on Linux Mint 18.3 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Reproduced in Version: 5.2.0.0.alpha0+ Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53 Threads 4; Ver: 4.10; Render: default; Version: 4.3.0.0.alpha1+ Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e
I am able to reproduce only partially: * I do see the Heading 1 and Text Body styles of the DOCX file are defined to have LTR direction, in their style properties. However, * I see the two paragraphs I had written using those styles still directed RTL (and right-aligned) Also using v6.0.2.1 on GNU/Linux Mint 18.3.
(In reply to Eyal Rozenberg from comment #3) > I am able to reproduce only partially: > > * I do see the Heading 1 and Text Body styles of the DOCX file are defined > to have LTR direction, in their style properties. However, > * I see the two paragraphs I had written using those styles still directed > RTL (and right-aligned) > > Also using v6.0.2.1 on GNU/Linux Mint 18.3. That's identical to what I get. the text that's already written stays RTL, but the styles are now all LTR, and if you apply any of them the text they are applied on becomes LTR.
This seems to happen with Arabic as well, so changing the "Blocking" bug number.
This is an excellent, clear problem description - thanks. Also applies to .DOC. Note that this ONLY seems to apply to completely new documents. If saved as ODF and re-loaded, then the export to docx saves the bidi setting. That suggests an "unset" default value is being skipped in the export process. Wrtw8styl.cxx OutputStyle identifies nPos==0 as "Normal" style, so we can force the RES_FRAMEDIR property to be ::SET here. The identical thing is happening on import in WW8RStyle::Import(). /* Word defaults to ltr not from environment like writer. Regardless of the page/sections rtl setting the standard style lack of rtl still means ltr */
proposed fix via these three parts: -https://gerrit.libreoffice.org/66964 tdf#116404 filter\ww8: use bidi for default style in RTL locale -https://gerrit.libreoffice.org/66965 tdf#116404 DOC: check locale if BiDi inherits Environment -https://gerrit.libreoffice.org/66966 tdf#116404 RTF: check locale if BiDi inherits Environment
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/06742182e5306d6d06e3253981723a69a3c978ab%5E%21 tdf#116404 filter\ww8: use bidi for default style in RTL locale It will be available in 6.3.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/ae4e0a81753dd280f6b77b5ee61cf7e9f85e5cfe%5E%21 tdf#116404 DOC: check locale if BiDi inherits Environment It will be available in 6.3.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/aebc79b670fb60c43dd07e8e963abe019754c092%5E%21 tdf#116404 RTF: check locale if BiDi inherits Environment It will be available in 6.3.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/daa4aef1512eb7a6b615720725a5a682b0030f8e%5E%21 try2 tdf#116404 filter\ww8: use bidi for default style in RTL locale It will be available in 6.3.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.