Bug 157598 - FILESAVE: DOCX: Text is converted to RTL when open with MSO
Summary: FILESAVE: DOCX: Text is converted to RTL when open with MSO
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords: bibisected, bisected, regression
: 157595 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-10-04 14:45 UTC by Xisco Faulí
Modified: 2023-10-05 10:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparsion LibreOffice 24.2 master vs MSO (97.46 KB, image/png)
2023-10-04 14:45 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2023-10-04 14:45:46 UTC
Created attachment 190008 [details]
Comparsion LibreOffice 24.2 master vs MSO

Steps to reproduce:
1. Open attachment 42599 [details] from bug 33597
2. Save as DOCX
3. Open it with MSO Word

-> Text is RTL. See Comparison

Reproduced in

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0c4913e03e8427a576138601958f2dbf13b8c37b
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

[Bug found by office-interoperability-tools]
Comment 1 Xisco Faulí 2023-10-04 14:46:31 UTC
Regression introduced by:

author	Hossein <hossein@libreoffice.org>	2023-08-15 14:56:53 +0200
committer	Hossein <hossein@libreoffice.org>	2023-08-21 14:26:51 +0200
commit 40ed8dd3a5a16f21f2e98440c62efa0fa6ec60ff (patch)
tree ce7605ffe666cfaf53bebb039d3dad2a1e13bebe
parent 8ec43f37a7a5babe9227a5ca1ea84720fc2e15e5 (diff)
tdf#155470 DOCX export: fix RTL numbers changed to LTR
 
Bisected with: bibisect-linux64-24.2

Adding Cc: to Hossein
Comment 2 Xisco Faulí 2023-10-04 14:47:24 UTC
According to the results from the office-interoperability-tools, I see hundred of files affected by this issue. Making it a critical issue
Comment 3 Xisco Faulí 2023-10-04 14:57:16 UTC
Attachment 89156 [details] from bug 43093 is a really simple example where "Hello World!" becomes "!Hello World" in Word
Comment 4 Regina Henschel 2023-10-04 15:07:39 UTC
I have noticed the same problem, see attachment 190005 [details] of bug 157595.
Comment 5 Xisco Faulí 2023-10-04 15:12:09 UTC
*** Bug 157595 has been marked as a duplicate of this bug. ***
Comment 6 Regina Henschel 2023-10-04 15:40:15 UTC
The problem in my example document is in word/styles.xml. The <w:rtl/> attribute shouldn't be there. If I remove the both occurrences, the rendering is OK in Word.
1.
    <w:docDefaults>
        <w:rPrDefault>
            <w:rPr>
                <w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:eastAsia="Times New Roman" w:cs="Times New Roman"/>
                <w:rtl/>
                <w:lang w:val="en-US" w:eastAsia="ja-JP" w:bidi="ar-SA"/>
            </w:rPr>
        </w:rPrDefault>
        <w:pPrDefault>
            <w:pPr>
                <w:suppressAutoHyphens w:val="true"/>
            </w:pPr>
        </w:pPrDefault>
    </w:docDefaults>

2.
    <w:style w:type="paragraph" w:styleId="Normal">
        <w:name w:val="Normal"/>
        <w:qFormat/>
        <w:pPr>
            <w:widowControl/>
            <w:kinsoku w:val="true"/>
            <w:overflowPunct w:val="true"/>
            <w:autoSpaceDE w:val="true"/>
            <w:bidi w:val="0"/>
            <w:spacing w:before="0" w:after="120"/>
            <w:jc w:val="start"/>
        </w:pPr>
        <w:rPr>
            <w:rFonts w:ascii="Cambria" w:hAnsi="Cambria" w:eastAsia="Times New Roman" w:cs="Times New Roman"/>
            <w:color w:val="auto"/>
            <w:kern w:val="0"/>
            <w:sz w:val="24"/>
            <w:szCs w:val="20"/>
            <w:rtl/>
            <w:lang w:val="de-DE" w:eastAsia="ja-JP" w:bidi="ar-SA"/>
        </w:rPr>
    </w:style>
Comment 7 Hossein 2023-10-04 20:27:19 UTC
I proposed a revert until I find a better solution that at avoids the problems in the above examples.

Revert "tdf#155470 DOCX export: fix RTL numbers changed to LTR"
https://gerrit.libreoffice.org/c/core/+/157547
Comment 8 Xisco Faulí 2023-10-05 08:15:42 UTC
Issue fixed with e0bedd3f7311bf47392a46d097304e3c7afcb246
Comment 9 Commit Notification 2023-10-05 10:41:14 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/98771c4a6da0e760b10983e66885fafcfe918d16

tdf#157598: sw_ooxmlexport18: Add unittest

It will be available in 24.2.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.