Bug 81507 - FILESAVE: DOCX - w:sdtContent not exported correctly resulting in missing line breaks
Summary: FILESAVE: DOCX - w:sdtContent not exported correctly resulting in missing lin...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.2 rc
Hardware: Other All
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.3.0 target:7.2.5
Keywords: bibisected, bisected, filter:docx, regression
: 79313 81504 (view as bug list)
Depends on:
Blocks: DOCX-Content_Control OOXML-Transitional-2010vs2013
  Show dependency treegraph
 
Reported: 2014-07-18 18:09 UTC by Yousuf Philips (jay) (retired)
Modified: 2023-08-22 00:34 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
how 4.2 compares to 4.3 (68.76 KB, image/png)
2014-07-18 18:09 UTC, Yousuf Philips (jay) (retired)
Details
the docx files outputted from 4.2 and 4.3 (16.97 KB, application/zip)
2014-07-18 18:10 UTC, Yousuf Philips (jay) (retired)
Details
word 2013 screenshot (3.26 KB, image/png)
2017-10-22 21:36 UTC, Yousuf Philips (jay) (retired)
Details
Screenshot of the original document in Word (46.67 KB, image/png)
2020-03-30 18:29 UTC, NISZ LibreOffice Team
Details
Screenshot of the roundtripped document in Word (40.13 KB, image/png)
2020-03-30 18:34 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-07-18 18:09:05 UTC
Created attachment 103059 [details]
how 4.2 compares to 4.3

After testing bug 81504, i noticed that the saved docx file outputted from 4.2.5 is different than 4.3.1 and master (9th July).

Steps:
* Download attachment 99947 [details]
* Open it using 4.2 and 4.3
* Save the file as .docx
* Open the files in Word

Behavior: see attached screenshot.
Comment 1 Yousuf Philips (jay) (retired) 2014-07-18 18:10:52 UTC
Created attachment 103060 [details]
the docx files outputted from 4.2 and 4.3
Comment 2 Jorendc 2014-07-18 18:24:35 UTC
Reproducible, as you can see in the first image the last paragraph is shown again at the top (so the first paragraph is getting deleted).

The text shown in the image of 4.2 is the same as the original document in Word for Mac 2011 does. So I agree this is a regression.

kind regards,
Joren
Comment 3 Michael Stahl (allotropia) 2014-07-24 16:04:59 UTC
saved with 4.2:

      <w:r>
        <w:rPr/>
        <w:t>aasdfasdkasdcmcxmzmzxç</w:t>
        <w:br/>
        <w:t>asdkjasdkaslkfzcxv</w:t>
        <w:br/>
        <w:br/>
        <w:br/>
        <w:t>asdflasjdfkasjdfasñldfjñalf</w:t>
      </w:r>

saved with 4.3:

      <w:sdt>
        <w:sdtPr>
          <w:text/>
          <w:dataBinding w:storeItemID="{6C3C8BC8-F283-45AE-878A-BAB7291924A1}" w:xpath="/ns1:coreProperties[1]/ns0:description[1]" w:prefixMappings="xmlns:ns0='http://purl.org/dc/elements/1.1/' xmlns:ns1='http://schemas.openxmlformats.org/package/2006/metadata/core-properties' "/>
        </w:sdtPr>
        <w:sdtContent>
          <w:r>
            <w:rPr/>
            <w:t>aasdfasdkasdcmcxmzmzxç</w:t>
          </w:r>
        </w:sdtContent>
      </w:sdt>
      <w:r>
        <w:rPr/>
        <w:br/>
        <w:t>asdkjasdkaslkfzcxv</w:t>
        <w:br/>
        <w:br/>
        <w:br/>
        <w:t>asdflasjdfkasjdfasñldfjñalf</w:t>
      </w:r>
      <w:r/>


perhaps the dataBinding xpath in there is pointing at the wrong thing,
and the sdtContent in there is actually ignored?


this is the commit:

commit 306859babd5a997a1e5d50e7791e8e5852a7ea2e
Author:     Jacobo Aragunde Pérez <jaragunde@igalia.com>
AuthorDate: Wed Mar 19 19:44:27 2014 +0100

    ooxml: preserve dataBinding tag in SDT properties
  (In reply to comment #0)
> Created attachment 103059 [details]
> how 4.2 compares to 4.3
> 
> After testing bug 81504, i noticed that the saved docx file outputted from
> 4.2.5 is different than 4.3.1 and master (9th July).
> 
> Steps:
> * Download attachment 99947 [details]
> * Open it using 4.2 and 4.3
> * Save the file as .docx
> * Open the files in Word
> 
> Behavior: see attached screenshot.
Comment 4 Björn Michaelsen 2014-10-16 14:59:22 UTC Comment hidden (obsolete)
Comment 5 Luke 2015-07-25 03:40:46 UTC
Miklos, this is your area of expertise. Could you kindly take a look at this regression?
Comment 6 Robinson Tryon (qubit) 2015-12-10 01:18:41 UTC Comment hidden (obsolete)
Comment 7 Yousuf Philips (jay) (retired) 2017-10-22 21:32:56 UTC
So with master, the text appears correct in Word 2010, but not in Word 2013. The problems seems to be that each <w:br /> isnt being wrapped in <w:r>, resulting in Word 2013 showing all the text joined together without the line breaks. LO exported XML.

<w:p>
 ...
 <w:r>
   <w:rPr></w:rPr>
   <w:t>aasdfasdkasdcmcxmzmzxç</w:t>
   <w:br />
   <w:t>asdkjasdkaslkfzcxv</w:t>
   <w:br />
   <w:br />
   <w:br />
   <w:t>asdflasjdfkasjdfasñldfjñalf</w:t>
 </w:r>
</w:p>

Original imported XML

<w:p w:rsidR="0011483A" w:rsidRDefault="0009519C">
 <w:r>
   <w:t>aasdfasdkasdcmcxmzmzxç</w:t>
 </w:r>
 <w:r>
   <w:br />
 </w:r>
 <w:r>
   <w:t>asdkjasdkaslkfzcxv</w:t>
 </w:r>
 <w:r>
   <w:br />
 </w:r>
 <w:r>
   <w:br />
 </w:r>
 <w:r>
   <w:br />
   <w:t>asdflasjdfkasjdfasñldfjñalf</w:t>
 </w:r>
</w:p>
Comment 8 Yousuf Philips (jay) (retired) 2017-10-22 21:36:09 UTC
Created attachment 137215 [details]
word 2013 screenshot
Comment 9 QA Administrators 2018-10-23 02:48:13 UTC Comment hidden (obsolete)
Comment 10 Luke 2018-10-24 19:15:42 UTC
Roundtripped file opened in Word 2016 still missing line breaks in 
Version: 6.2.0.0.alpha0+ (x64)
Build ID: 5e8cd8683d345b75297994b3f7aab851835eb124
Comment 11 QA Administrators 2019-10-25 02:40:35 UTC Comment hidden (obsolete)
Comment 12 NISZ LibreOffice Team 2020-03-30 18:29:15 UTC
Created attachment 159169 [details]
Screenshot of the original document in Word

Problem seems to be that the original content controls properties have the "Enable carriage return characters (multiple paragraphs)" setting enabled, but the document saved by LO does not.

Version: 7.0.0.0.alpha0+ (x64)
Build ID: bc898e2c2784e36ad4d4cdf6d962e39069d2c82d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: CL
Comment 13 NISZ LibreOffice Team 2020-03-30 18:34:58 UTC
Created attachment 159170 [details]
Screenshot of the roundtripped document in Word

Checkbox at the bottom now unchecked
Comment 14 NISZ LibreOffice Team 2020-03-30 18:35:19 UTC
*** Bug 81504 has been marked as a duplicate of this bug. ***
Comment 15 NISZ LibreOffice Team 2020-03-30 18:39:11 UTC
*** Bug 79313 has been marked as a duplicate of this bug. ***
Comment 16 Commit Notification 2021-11-18 07:43:20 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/75a49947c2eeb831a8e02192f1c4856eac62a743

tdf#81507: word content control support for w:multiLine

It will be available in 7.3.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 17 Commit Notification 2021-11-18 14:03:43 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/48e947333b51b3834eec21ccb0793bd7f5d589d7

tdf#81507: word content control support for w:multiLine

It will be available in 7.2.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.
Comment 18 Gabor Kelemen (allotropia) 2021-11-25 12:57:30 UTC
The property is now roundtripped correctly in:

Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 515682539623c9d61921c4f89302ffa0a4cb8d24
CPU threads: 13; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded
Comment 19 Christian Lohmaier 2021-12-06 13:28:48 UTC
7.2.4 was a hotfix release, updating target in status-whiteboard