Bug 153967 - Writer import filter misinterprets/ignores direction of RTL lines
Summary: Writer import filter misinterprets/ignores direction of RTL lines
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf
Depends on:
Blocks: RTL-CTL PDF-Import-Writer
  Show dependency treegraph
 
Reported: 2023-03-04 18:46 UTC by Eyal Rozenberg
Modified: 2023-03-21 13:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Original Writer document with RTL text and underscores (9.65 KB, application/vnd.oasis.opendocument.text)
2023-03-04 18:46 UTC, Eyal Rozenberg
Details
Writer-exported PDF (5.09 KB, application/pdf)
2023-03-19 19:22 UTC, Eyal Rozenberg
Details
Screenshot of attachment 186082 in Writer and in a native viewer (30.55 KB, image/png)
2023-03-19 19:25 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2023-03-04 18:46:47 UTC
Created attachment 185751 [details]
Original Writer document with RTL text and underscores

Consider the PDF produced from the attached ODT.

(the second line in it has a space between the text and the underscores)

In the ODT, the underscores _follow_ the Hebrew text; and the same is true when viewing the exported PDF. But when we import the PDF into Writer - the underscores appear first, then the RTL text (with or without the space).

Note that when importing into Draw, this does _not_ occur.
Comment 1 Eyal Rozenberg 2023-03-04 18:48:22 UTC
Should this be considered "loose ends" from bug 104597?
Comment 2 Eyal Rozenberg 2023-03-04 18:54:01 UTC
On closer inspection - it seems the issue is the choice of direction for the text box (corresponding to a line or text run in the original PDF): The line is supposed to be set to RTL, but is imported as LTR. If we change the direction, the order of underscores and RTL text is appropriate.
Comment 3 Dieter 2023-03-19 17:25:24 UTC
(In reply to Eyal Rozenberg from comment #0)
> Created attachment 185751 [details]
> Original Writer document with RTL text and underscores
> 
> Consider the PDF produced from the attached ODT.
> 
> (the second line in it has a space between the text and the underscores)

In ODT-file (attachment 185751 [details]) there is a space between text and underscores. And therefore there is a space in PDF-file and in Draw-file, that is opened when trying to open PDF-file in wirter. So I can't see the problem here. Could you please clearify it?
=> NEEDINFO
Comment 4 Eyal Rozenberg 2023-03-19 19:21:18 UTC
(In reply to Dieter from comment #3)
> So I can't see the problem here. Could you please clearify it?

Perhaps you didn't specifically have the PDF open in Writer, seeing how you asked about this in bug 152679? Anyway, will soon attach the PDF and a screenshot.
Comment 5 Eyal Rozenberg 2023-03-19 19:22:16 UTC
Created attachment 186082 [details]
Writer-exported PDF

The PDF is ok - the underscores follow the text, to its left.
Comment 6 Eyal Rozenberg 2023-03-19 19:25:10 UTC
Created attachment 186083 [details]
Screenshot of attachment 186082 [details] in Writer and in a native viewer

Screenshot of the export PDF in Writer and in a native viewer.

Notes:

* The wrong choice of font is an unrelated issue (bug 143095).
* The second line says מילהואזרווח without a space, then a space, then underscores. This is intentional, i.e. I've concatenated a few words together since I only want one space.
Comment 7 Eyal Rozenberg 2023-03-19 19:27:05 UTC
Oh, I should mention that you need to try it in LO 7.5 or earlier, as in 7.6 this whole business is masked by the more severe bug 153969, due to which _no_ text is imported into Writer. I'm guessing that when that one is resolved, we'll see this one in 7.6 as well.
Comment 8 QA Administrators 2023-03-20 03:27:13 UTC Comment hidden (obsolete)
Comment 9 Stéphane Guillou (stragu) 2023-03-21 13:15:44 UTC
Reproduced in:

Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(To avoid the disappearing text issue described in bug 153969, don't use the he-IL locale.)