Bug 118361 - DOC/DOCX: Footnote separator Line position is wrong when locale doesn't match RTL/LTR
Summary: DOC/DOCX: Footnote separator Line position is wrong when locale doesn't match...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.2.0 target:6.1.0.2
Keywords:
Depends on:
Blocks: DOCX-Footnote-Endnote
  Show dependency treegraph
 
Reported: 2018-06-25 05:26 UTC by Fahad Al-Saidi
Modified: 2019-09-27 05:21 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (16.14 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-25 05:26 UTC, Fahad Al-Saidi
Details
docx file open in word 2016 (60.98 KB, image/png)
2018-06-25 05:26 UTC, Fahad Al-Saidi
Details
docx file opened in writer (69.83 KB, image/png)
2018-06-25 05:27 UTC, Fahad Al-Saidi
Details
Settings png (86.88 KB, image/png)
2018-06-25 13:30 UTC, chamfay
Details
gibberish.odt: with English locale, footnote separator is left-aligned. (10.46 KB, application/vnd.oasis.opendocument.text)
2018-06-27 06:12 UTC, Justin L
Details
tdf118361_poc.patch: docx import proof of concept (3.73 KB, patch)
2018-06-27 11:07 UTC, Justin L
Details
tdf82173_footnoteStyle.docx: LTR documents have the opposite problem for RTL-locales (13.68 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-27 14:31 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fahad Al-Saidi 2018-06-25 05:26:17 UTC
Created attachment 143082 [details]
test file

I have footnotes in docx file in RTL direction when I open the file in writer the Footnote separator Line position is set to Left which is wrong. 

Please have look into screen shots & test file.
Comment 1 Fahad Al-Saidi 2018-06-25 05:26:47 UTC
Created attachment 143083 [details]
docx file open in word 2016
Comment 2 Fahad Al-Saidi 2018-06-25 05:27:17 UTC
Created attachment 143084 [details]
docx file opened in writer
Comment 3 Dieter 2018-06-25 08:04:43 UTC
I can confirm this with

Version: 6.1.0.0.beta2 (x64)
Build ID: 0f4d2060bc90b4008fbc8e6d9a49ec7eeea60b78
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (de_DE); Calc: CL

Noel, you fixed the similar bug 115432. Perhaps you can have a look at it?
Comment 4 chamfay 2018-06-25 13:30:26 UTC
Created attachment 143098 [details]
Settings png
Comment 5 chamfay 2018-06-25 13:31:31 UTC
By changing "local setting" option to any arabic language, all works fine!
if you want to write an RTL document you must do that.

Regards.
Comment 6 Fahad Al-Saidi 2018-06-26 04:19:37 UTC
(In reply to chamfay from comment #5)
> By changing "local setting" option to any arabic language, all works fine!
> if you want to write an RTL document you must do that.
> 
> Regards.

thanks for the workaround but still it is a valid bug.
Comment 7 Xisco Faulí 2018-06-26 09:40:05 UTC
issue reproduced back to

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 8 Xisco Faulí 2018-06-26 09:41:14 UTC
@Justin, I thought you could be interested in this issue...
Comment 9 Justin L 2018-06-27 06:12:21 UTC
Created attachment 143152 [details]
gibberish.odt: with English locale, footnote separator is left-aligned.

(In reply to Fahad Al-Saidi from comment #0)
If you CREATE this document in Libreoffice with your non-Arabic locale, what do you get?  With my English locale, I created a couple of paragraphs using Arabic script, set the paragraphs to RTL direction, and then added a footnote. The footnote separator was on the left.

If this is really true, then this has nothing to do with docx - it would be true also with odt etc. And then the computer would just need to guess (based on the first footnote?) whether to right or left align.
Comment 10 Fahad Al-Saidi 2018-06-27 06:19:54 UTC Comment hidden (no-value)
Comment 11 Justin L 2018-06-27 06:25:09 UTC
(In reply to Fahad Al-Saidi from comment #10)
> There are many bugs with footnote in RTL.
We only look at one bug per report, so please focus on the specific questions asked. Since this bug appears to be unrelated to docx, I removed the references to that in the subject line.
Comment 12 Fahad Al-Saidi 2018-06-27 10:24:42 UTC
(In reply to Justin L from comment #9)
> Created attachment 143152 [details]
> gibberish.odt: with English locale, footnote separator is left-aligned.
> 
> (In reply to Fahad Al-Saidi from comment #0)
> If you CREATE this document in Libreoffice with your non-Arabic locale, what
> do you get?  With my English locale, I created a couple of paragraphs using
> Arabic script, set the paragraphs to RTL direction, and then added a
> footnote. The footnote separator was on the left.


I get the same result.
Comment 13 Justin L 2018-06-27 11:07:58 UTC
Created attachment 143157 [details]
tdf118361_poc.patch: docx import proof of concept

This is my understanding of the current situation. In LO, the default values of the Page Style are changed based on the locale. Arabic locale changes default for Page format - Footnote - Position to RIGHT. Any new documents will get this default, as will imports that don't specify a value .

.docx file doesn't provide the location of the separator as a property. It appears to depend on the value of the default paragraph style (based on my observations). If the default style is RTL, the separator is RIGHT aligned.

So, since this is a direct property that doesn't "mean different things depending on RTL settings", it should be safe to import doc/docx by testing the default paragraph style.
Comment 14 Justin L 2018-06-27 14:29:44 UTC
@chamfay, you should notice the opposite problem importing docx footnotes from LTR documents. With your Arabic locale, this example has a right-aligned footnote separator, when it ought to be left. Correct?

proposed fix at gerrit.libreoffice.org/56532
Comment 15 Justin L 2018-06-27 14:31:55 UTC
Created attachment 143163 [details]
tdf82173_footnoteStyle.docx: LTR documents have the opposite problem for RTL-locales
Comment 16 Commit Notification 2018-07-10 05:53:30 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=139750d7c295b84f4c42bf9409ccbdfb0c46b9f6

tdf#118361 sw ooxmlimport: set footnote separator alignment

It will be available in 6.2.0.

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 17 Commit Notification 2018-07-12 09:22:08 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=37a27823ad181387943a3193236f2cca6d3ec0d6&h=libreoffice-6-1

tdf#118361 sw ooxmlimport: set footnote separator alignment

It will be available in 6.1.0.2.

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 18 Dieter 2019-09-27 05:21:24 UTC
VERIFIED with

Version: 6.3.2.2 (x64)
Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded