Bug 153969 - Text hidden when importing PDF document with RTL text and using he-IL locale
Summary: Text hidden when importing PDF document with RTL text and using he-IL locale
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.4.2 release
Hardware: All All
: medium normal
Assignee: Kevin Suo
URL:
Whiteboard: target:24.2.0 target:7.6.4
Keywords: bibisected, bisected, filter:pdf, regression
Depends on:
Blocks: PDF-Import-Writer
  Show dependency treegraph
 
Reported: 2023-03-04 19:06 UTC by Eyal Rozenberg
Modified: 2023-11-28 08:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF with RTL text and parentheses (5.63 KB, application/pdf)
2023-03-04 19:06 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 19:06:18 UTC
Created attachment 185753 [details]
PDF with RTL text and parentheses

Consider the attached PDF document, produced by typing in 

אחת (שתיים) שלוש

in Writer, and exporting to PDF.

If we open the resulting PDF in Writer, we get an _empty_ document.

Note: In Draw, we do see the line of text, although there is currently a bug regarding the parentheses, see 153968.
Comment 1 Eyal Rozenberg 2023-03-04 19:08:49 UTC
Seen with:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US
Comment 2 Eyal Rozenberg 2023-03-04 19:25:37 UTC
Not seen with a 7.5 release!

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 3 Roman Kuznetsov 2023-03-19 19:40:23 UTC
No repro in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL threaded

gtk only?
Comment 4 Stéphane Guillou (stragu) 2023-03-20 08:49:23 UTC
It works for me on Linux with gtk3 vcl. Although I get inverted parentheses (but it's the same as in Draw):

אחת )שתיים( שלוש

It uses a fallback font.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1aeacf54bf6c961d89678e961c747ff76d867c5f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Your build seems to be about 3 months old, please test with a more recent one.
Comment 5 Eyal Rozenberg 2023-03-20 21:02:57 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Your build seems to be about 3 months old, please test with a more recent
> one.

Bug manifests with:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US

... downloaded yesterday.

Nothing is imported when opening the attached PDF in Writer.
Comment 6 QA Administrators 2023-03-21 03:25:39 UTC Comment hidden (obsolete)
Comment 7 Stéphane Guillou (stragu) 2023-03-21 11:12:55 UTC
For anyone testing: to import a PDF in Writer, you have to go to the Open dialog and use "PDF (Writer)" from the dropdown of filetypes. Or you can use the following parameter in the command line:

 --infilter="writer_pdf_import"

I could only reproduce by using the locale en-IL:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 64d1a735b2b371495bfd56faf7070fb3274533ad
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: he-IL (he-IL); UI: en-US
Calc: threaded

Drawing object is still present, placed on the left and text is displayed when editing it.
Comment 8 Stéphane Guillou (stragu) 2023-03-21 12:58:20 UTC
Bibisected with linux-64-7.4 repo to first bad commit b77a5408177cf0db37ca5aa3d9cf106c0157ab9b which points to core commit 588e59cc36475ded243ce4fd9062473cddd2c016 which is a cherry-pick of:

commit 9ea9d3ccc0f8e4833e745d9655b61d42d6d8fe83
author	Kevin Suo <suokunlong@126.com>	Sun Oct 23 19:10:29 2022 +0800
committer	Noel Grandin <noel.grandin@collabora.co.uk>	Sun Nov 06 12:43:07 2022 +0100
tree 8e807537a5ff745c601815ad1f43ce13bc29138b
parent 7351bf23f5f92b1e59436b3f7b99ed52ab03bf4e
sdext.pdfimport Writer: Do not visit DrawElement twice in WriterXmlEmitter
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141680

Kevin, can you please have a look?
Comment 9 Eyal Rozenberg 2023-03-21 14:46:14 UTC
(In reply to Stéphane Guillou (stragu) from comment #8)
> Bibisected with linux-64-7.4 repo to first bad commit

That's a bit strange, since I don't see this with 7.5. Are you absolutely sure? Or - could it be that the commit was back-ported to 7.4 from later work?

(In reply to Stéphane Guillou (stragu) from comment #7)
> Drawing object is still present, placed on the left and text is displayed
> when editing it.

Good catch! But how is this possible? The text color is not white, nor is there any transparency. Weird.
Comment 10 Stéphane Guillou (stragu) 2023-03-21 15:58:24 UTC
(In reply to Eyal Rozenberg from comment #9)
> (In reply to Stéphane Guillou (stragu) from comment #8)
> > Bibisected with linux-64-7.4 repo to first bad commit
> 
> That's a bit strange, since I don't see this with 7.5. Are you absolutely
> sure? Or - could it be that the commit was back-ported to 7.4 from later
> work?

Change was included in trunk before 7.5 branching and also cherrypicked to 7.4.4.
Keep in mind that your dev version probably uses a different user profile than your other releases, so double-check which locale you are using in those earlier ones. Is it also he-IL ?
Comment 11 Eyal Rozenberg 2023-03-21 16:05:19 UTC
(In reply to Stéphane Guillou (stragu) from comment #10)
> Keep in mind that your dev version probably uses a different user profile
> than your other releases, so double-check which locale you are using in
> those earlier ones. Is it also he-IL ?

Actually, it's

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 12 Stéphane Guillou (stragu) 2023-03-21 16:08:13 UTC
(In reply to Eyal Rozenberg from comment #11)
> Actually, it's
> 
> Version: 7.5.0.3 (X86_64) / LibreOffice Community
> Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
> CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
> Locale: en-IL (en_IL); UI: en-US

Precisely. Change it to he-IL in your Language options and I think you'll see the same issue.
Comment 13 Kevin Suo 2023-04-04 11:02:36 UTC
Thanks for letting me know this regression. I will take a look at this when I have time, but I am currently very busy these days.
Comment 14 Kevin Suo 2023-11-22 08:58:15 UTC
I am reversing that commit:
https://gerrit.libreoffice.org/c/core/+/159811
Comment 15 Commit Notification 2023-11-28 02:09:45 UTC
Kevin Suo committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5589659829f8a1cef8ca1c8a468732105bbe231b

tdf#157589 tdf#153969: Revert "sdext.pdfimport Writer: Do not visit...

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.
Comment 16 Commit Notification 2023-11-28 08:47:23 UTC
Kevin Suo committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/f52d8f004f7d70f89ee805c6f71f1791cac70c0f

tdf#157589 tdf#153969: Revert "sdext.pdfimport Writer: Do not visit...

It will be available in 7.6.4.

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.