Bug 44029 - FILESAVE: DOCX - Files with RTL paragraphs aren't compatible with Word
Summary: FILESAVE: DOCX - Files with RTL paragraphs aren't compatible with Word
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 Beta1
Hardware: All All
: medium normal
Assignee: Faisal Menawer
URL:
Whiteboard: target:4.3.0
Keywords:
Depends on:
Blocks: DOCX RTL
  Show dependency treegraph
 
Reported: 2011-12-21 12:20 UTC by Ophir Yoktan
Modified: 2024-08-03 09:15 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
sample docx file with an RTL paragraph (3.44 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2011-12-21 12:20 UTC, Ophir Yoktan
Details
RTL save bug (created with LO set to RTL locale) (8.33 KB, application/vnd.oasis.opendocument.text)
2013-11-24 16:00 UTC, Maxim Monastirsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ophir Yoktan 2011-12-21 12:20:45 UTC
Created attachment 54652 [details]
sample docx file with an RTL paragraph

When generating a docx file with a RTL paragraph, the paragraph looks fine in LibreOffice.

But when opening the file in MS Word (2007 / 2010) the paragraph appears as LTR.
Comment 1 Lior Kaplan 2013-07-21 10:29:14 UTC
This commit is relevant for this bug http://cgit.freedesktop.org/libreoffice/core/commit/?id=e9911f12d1e124d1910ac2310c224e66ab365ed4

docx: fdo#43093 fdo#44029 fix the alignment when the paragraph are RTL
Comment 2 Ophir Yoktan 2013-07-23 08:31:23 UTC
It that the latest build still has the problem
(tested using Build ID: cb14b1e56d2aab70d28afca8bf039a27f89671c8)
Comment 3 Ahmad Harthi 2013-08-22 22:54:24 UTC
Hello Ophir Yoktan,

I've tested Faisal's patch and it works for me, can you check again please?
Comment 4 Maxim Monastirsky 2013-11-24 16:00:07 UTC
Created attachment 89714 [details]
RTL save bug (created with LO set to RTL locale)

Hi Faisal,

I found one more problem, with LO set to RTL locale (so the default paragraph direction is RTL right aligned): if you open a new document, write some text and save to docx, it will open in MS Word as RTL *left* aligned. Opening the docx in LO still shows RTL right aligned, so it both opening & saving bug.

It's happening only at the beginning of a document, as changing direction\alignment to something else, and later changing back does open\save correctly.

Looks like it caused by the locale where the original document is created, because opening this document in LO set to LTR locale and saving to docx, also shows the bug.
Comment 5 Commit Notification 2013-12-08 07:08:31 UTC
Faisal M. Al-Otaibi committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4add062a1b1feb11f9b14d3a0593a8f9b27f2404

docx: fdo#44029 export the right alignment when locale are RTL.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Maxim Monastirsky 2013-12-10 10:43:21 UTC
Hi Faisal,

Thank you for all your efforts in fixing docx direction bugs. I really appreciate your patience!

I can confirm the fix with master build. But it's apply only when locale set to RTL. Problem is still there if you open & save using LO with LTR locale, a document previously created with RTL locale. (Isn't it easier to just force LO to always export the alignment regardless the default?) Also would be great if you could commit also to libreoffice-4-2 so all users could benefit your great work in the near future.

To not clutter this bug, I opened Bug 72560 for one more problem. It's unfortunate that after all my intensive tests with real world documents, there are still issues!

You might be also interested in Bug 72017. It's a document created using LO probably before your patches.

Thank you again!
Comment 7 Faisal Menawer 2013-12-16 06:17:43 UTC
(In reply to comment #6)
> Hi Faisal,
> 
> Thank you for all your efforts in fixing docx direction bugs. I really
> appreciate your patience!

you are welcome :)
and thank you for your test and verified the patches.

> I can confirm the fix with master build. But it's apply only when locale set
> to RTL. Problem is still there if you open & save using LO with LTR locale,
> a document previously created with RTL locale. (Isn't it easier to just
> force LO to always export the alignment regardless the default?) Also would
> be great if you could commit also to libreoffice-4-2 so all users could
> benefit your great work in the near future.

hmmm i can't reproduce it with libreoffice
Build ID: 6e6d0ef0b8fd5b89aeb292700cca3096a03681bf

can you see if it is still there
if yes please upload a test file.

thanks.
Comment 8 Maxim Monastirsky 2013-12-18 17:12:11 UTC
(In reply to comment #7)
> can you see if it is still there
> if yes please upload a test file.
It's reproducible with attachment 89714 [details]. Make sure to set LO to LTR locale. The result document will right aligned with LO, but left aligned with MS Word. Tested with Build ID: 4c539fac018dfd44cd8db52161a8cb930c627da7.
Comment 9 QA Administrators 2015-04-19 03:23:28 UTC Comment hidden (obsolete)
Comment 10 Ophir Yoktan 2015-04-19 06:17:31 UTC
appears to be working on latest version : 4.4.2.2 (Windows)
Comment 11 Buovjaga 2015-06-19 15:05:31 UTC
WFM per comment 10.
Comment 12 Xisco Faulí 2020-06-10 10:39:56 UTC
I came across this issue and found it was fixed by https://cgit.freedesktop.org/libreoffice/core/commit/?id=b524cab24b8f7c39104db7842e071599eb1d674f ( at least when attachment 89714 [details] is converted from commandline using --convert-to docx )