Bug 118350 - Writer can't handle RTL direction from MS office odt file.
Summary: Writer can't handle RTL direction from MS office odt file.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-24 18:11 UTC by Fahad Al-Saidi
Modified: 2021-09-28 09:43 UTC (History)
3 users (show)

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


Attachments
rtl odt created by ms office 2016 (8.62 KB, application/vnd.oasis.opendocument.text)
2018-06-24 18:11 UTC, Fahad Al-Saidi
Details
screen shot (197.70 KB, image/png)
2018-06-24 18:16 UTC, Fahad Al-Saidi
Details
Writer in windows (72.58 KB, image/png)
2018-06-25 05:01 UTC, Fahad Al-Saidi
Details
word 2016 screen shot (63.63 KB, image/png)
2018-06-25 05:06 UTC, Fahad Al-Saidi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fahad Al-Saidi 2018-06-24 18:11:15 UTC
Created attachment 143074 [details]
rtl odt created by ms office 2016

in attachment a test odt file generated by MS office 2016 which is RTL, however, when I open it in writer is displayed as LTR. see the screenshot.
Comment 1 Fahad Al-Saidi 2018-06-24 18:16:02 UTC
Created attachment 143075 [details]
screen shot
Comment 2 Susan Gessing 2018-06-24 20:34:10 UTC
I opened the attachment in each of the following builds. I wasn't able to reproduce the problem. (Windows 8.1)

Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
Locale: en-US (en_US); Calc: CL

 and

Version: 6.2.0.0.alpha0+
Build ID: b1740fba0d1e6e3d69c3781734509317f42a0e4f
CPU threads: 4; OS: Windows 6.3; UI render: GL; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-06-15_08:49:04
Locale: en-US (en_US); Calc: CL
Comment 3 Fahad Al-Saidi 2018-06-25 05:01:26 UTC
Created attachment 143080 [details]
Writer in windows
Comment 4 Fahad Al-Saidi 2018-06-25 05:01:39 UTC
(In reply to Susan Gessing from comment #2)
> I opened the attachment in each of the following builds. I wasn't able to
> reproduce the problem. (Windows 8.1)
> 
> Version: 6.0.5.2 (x64)
> Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
> CPU threads: 4; OS: Windows 6.3; UI render: GL; 
> Locale: en-US (en_US); Calc: CL
> 
>  and
> 
> Version: 6.2.0.0.alpha0+
> Build ID: b1740fba0d1e6e3d69c3781734509317f42a0e4f
> CPU threads: 4; OS: Windows 6.3; UI render: GL; 
> TinderBox: Win-x86@42, Branch:master, Time: 2018-06-15_08:49:04
> Locale: en-US (en_US); Calc: CL


You may not notice the direction. It is Right in Word and left in Writer. I have tested the doc in windows and I can reproduce it.

Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 1; OS: Windows 6.1; UI render: default; 
Locale: en-US (en_US); Calc: group

See the attached screen shot and please confirm.
Comment 5 Fahad Al-Saidi 2018-06-25 05:06:09 UTC
Created attachment 143081 [details]
word 2016 screen shot

to be clear here is how it looks in word 2016
Comment 6 Susan Gessing 2018-06-25 16:48:21 UTC
You are correct. I retested in the 2 builds and the text in LibreOffice DOES incorrectly display as left to right.

Sorry I misread.
Comment 7 Xisco Faulí 2018-06-26 09:35:38 UTC
I can reproduce it back to 

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

the question is: is it a LibreOffice problem or a MS Office problem not following the ODF standard ?
Could you please explain how the document was created?
Comment 8 Fahad Al-Saidi 2018-06-26 09:56:18 UTC
(In reply to Xisco Faulí from comment #7)
> I can reproduce it back to 
> 
> LibreOffice 3.3.0 
> OOO330m19 (Build:6)
> tag libreoffice-3.3.0.4
> 
> the question is: is it a LibreOffice problem or a MS Office problem not
> following the ODF standard ?
> Could you please explain how the document was created?

There is no special way I followed in creating the test. Just I opened word then I write in it and I add some footnote and format the text to be RTL.

Now in writer, the direction of the text is changed to be Left as seen in the screenshot.
Comment 9 Regina Henschel 2018-06-26 15:06:57 UTC
For me the file from Word looks good. It has paragraph attributes:
fo:text-align="start"
style:writing-mode="rl-tb"
style:language-complex="ar"
style:country-complex="OM"
and for the character "space" a script-type="complex"

I do not find any code in LibreOffice, that handles fo:text-align for import in Writer. But you know the code base is huge. A Writer expert should look at it.

For me it looks like an error in LibreOffice.
Comment 10 Regina Henschel 2018-06-26 17:03:18 UTC
See also bug 37128.
Comment 11 Fahad Al-Saidi 2018-12-17 05:12:01 UTC
(In reply to Regina Henschel from comment #10)
> See also bug 37128.

You are right. The rtl ODT created in Writer will show left alignment in words.

Right now I can't use odt format to exchange documents. Ironically, Doc format is better here.
Comment 12 Justin L 2019-01-26 14:50:05 UTC
(In reply to Regina Henschel from comment #9)
> I do not find any code in LibreOffice, that handles fo:text-align for import
adjushdl.cxx??  It contains
SvXMLEnumMapEntry<style::ParagraphAdjust> const pXML_Para_Adjust_Enum[] =
{
    { XML_START,        style::ParagraphAdjust_LEFT },
    { XML_END,          style::ParagraphAdjust_RIGHT },
    { XML_CENTER,       style::ParagraphAdjust_CENTER },
    { XML_JUSTIFY,      style::ParagraphAdjust_BLOCK },
    { XML_JUSTIFIED,    style::ParagraphAdjust_BLOCK }, // obsolete
    { XML_LEFT,         style::ParagraphAdjust_LEFT },
    { XML_RIGHT,        style::ParagraphAdjust_RIGHT },
    { XML_TOKEN_INVALID, style::ParagraphAdjust(0) }
};
Comment 13 QA Administrators 2021-01-26 05:11:48 UTC Comment hidden (obsolete)
Comment 14 Fahad Al-Saidi 2021-09-28 09:43:52 UTC
I tested with libreoffice 7.2 & the bug is still present