Bug 156582 - FILEOPEN DOCX: Opening and closing square brackets incorrectly reversed in RTL paragraph
Summary: FILEOPEN DOCX: Opening and closing square brackets incorrectly reversed in RT...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-RTL
  Show dependency treegraph
 
Reported: 2023-08-02 12:19 UTC by Hossein
Modified: 2023-08-13 12:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX file only containing the text: [1] (12.06 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-08-02 12:19 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-08-02 12:19:54 UTC
Created attachment 188726 [details]
DOCX file only containing the text: [1]

Description:
Opening and closing square brackets incorrectly reversed in an RTL paragraph.

Steps to Reproduce:
1. Open the attached .docx file in Writer
2. Open the attached file in MS Word
3. Compare the output

Actual Results:
[ and ] are replaced incorrectly. The text is displayed as ]1[ which is incorrect.


Expected Results:
The text should be displayed as [1].

Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 316215486b2fb255f4deea073e4d43671c4325c1
CPU threads: 20; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: CL threaded
Comment 1 Dieter 2023-08-13 09:58:52 UTC
I can't confirm with

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e25e27c85ed970cdb97c468bdac86c80964f4231
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

I could only test with MS Word 365. But if I open attachment 188726 [details] file shows also result ]1[.
On the other hand, if I create a document with content [1] in Word 365, result in LO is O.K.
Comment 2 ⁨خالد حسني⁩ 2023-08-13 12:21:40 UTC
This is one of these Word quirky RTL features. If you change the paragraph direction in Word the brackets get reversed, in LibreOffice they render the same, as they should since they souldn’t be dependent on paragraph direction.
Comment 3 ⁨خالد حسني⁩ 2023-08-13 12:30:29 UTC
The underlying text is ]1[, and Word will render it [1] when the paragraph direction is RTL (i.e. it does not mirror it), but this makes no sense, if I want [1] I type that and it renders correctly regardless of paragraph direction (since we will mirror the brackets if the text is RTL).

I word is basically representing the text like this:

LTR: ]
RTL: 1
LTR: [

But we probably don't have support for setting direction inline so we loose that information and all we see is ]1[.