Bug 148150 - Fileopen DOCX: LO does not keep carriage return in form field of Rich Text Content Control
Summary: Fileopen DOCX: LO does not keep carriage return in form field of Rich Text Co...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:7.5.0
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
Reported: 2022-03-23 17:39 UTC by Sophie
Modified: 2022-07-26 09:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

original file (19.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-03-23 17:40 UTC, Sophie
result file (18.48 KB, application/pdf)
2022-03-23 17:40 UTC, Sophie
The example file in current master (279.73 KB, image/png)
2022-07-25 19:30 UTC, Gabor Kelemen (allotropia)

Note You need to log in before you can comment on or make changes to this bug.
Description Sophie 2022-03-23 17:39:48 UTC
When we try to convert a docx file to PDF with headless mode, carriage returns contained in form/control fields are lost, and the text is all in one line (and no space replacing carriage return).
Please my exemple files : original docx containing text with carriage return, and the PDF result.

Steps to Reproduce:
1. convert file with command line : libreoffice --headless --convert-to pdf myfile.docx --outdir ./
2. compare docx and PDF, you'll see !

Actual Results:
Carriage returns are not kept

Expected Results:
Carriage returns SHOULD be kept

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 2; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 1 Sophie 2022-03-23 17:40:34 UTC
Created attachment 179052 [details]
original file
Comment 2 Sophie 2022-03-23 17:40:52 UTC
Created attachment 179053 [details]
result file
Comment 3 Sophie 2022-03-24 07:20:05 UTC
I want to be more precise after some aditionnal tests.
In fact the PDF generation is ok.
The issue is that carriage return are not read correctly by libreoffice when coming from MSWord.
My file was created on word with the carriag return on the second line, and we don't see it when we open the file in libreoffice.
If i try to put a carriag return in libreoffice, the PDF is ok.

So in resume, the problem is : libreoffice does not keep/display carriage return in form field/controls when the file is created from MSWord.
Comment 4 Timur 2022-03-24 14:28:52 UTC
Repro 7.4+. Worse with new line/enters, when text stays out in LO, so not trivial.
Seems like LO should support Rich Text Content Controls.
Comment 5 Sophie 2022-03-24 14:32:54 UTC
What is L0 ? 
yes you're right, it's probably due to rich content (even if my content is not very rich...)
Comment 6 Gabor Kelemen (allotropia) 2022-07-25 19:30:55 UTC
Created attachment 181407 [details]
The example file in current master

The line breaks are now imported and exported in:

Version: / LibreOffice Community
Build ID: 7a48b95e2516f51460341c6e0f8f991cca93c6f2
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded


author	Miklos Vajna <vmiklos@collabora.com>	Mon Jul 25 09:13:03 2022 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Mon Jul 25 09:51:22 2022 +0200

sw content controls, plain text: add DOCX import
Comment 7 Gabor Kelemen (allotropia) 2022-07-25 19:46:11 UTC
Thanks Miklos for fixing this!
(but I'll open some new bugs for the still lost properties)