Bug 73238 - FILEOPEN: some objects and picture in DOCX file with many objects misplaced
Summary: FILEOPEN: some objects and picture in DOCX file with many objects misplaced
Status: RESOLVED DUPLICATE of bug 127368
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
 
Reported: 2014-01-02 20:31 UTC by rhart9
Modified: 2019-11-01 09:23 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
.docx file (169.67 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-01-02 20:31 UTC, rhart9
Details
PDF file as docx should look (84.38 KB, application/pdf)
2014-01-02 20:35 UTC, rhart9
Details
Screenshot of the document in Writer master and Word (707.17 KB, image/png)
2019-10-11 09:34 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rhart9 2014-01-02 20:31:19 UTC
Created attachment 91434 [details]
.docx file

Have attached file that incorrectly formats.  Can send a .PDF of "should be" if it would be helpful. 

Been using OpenOffice for a while.  LOVE LibreOffice!!!

Thanks for the work.
Comment 1 rhart9 2014-01-02 20:35:20 UTC
Created attachment 91435 [details]
PDF file as docx should look

Realized I could add .PDF this way.
Comment 2 Thomas van der Meulen [retired] 2014-01-03 11:51:51 UTC
Thank you for your bug report, I can reproduce this bug running 
Version: 4.2.0.1
Build ID: 7bf567613a536ded11709b952950c9e8f7181a4a
OS: Mac osx 10.9.1
Comment 3 retired 2014-01-03 11:54:42 UTC
Confirmed:4.2.0.1:OSX

Opening with word displays as in attached PDF file (correctly). When opening with LO 4.2.0.1 structure is broken and images misplaced.

NEW.
Comment 4 Joel Madero 2015-05-02 15:44:22 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2015-06-21 13:52:35 UTC
Confirmed.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 3ecef8cedb215e49237a11607197edc91639bfcd
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_23:16:58
Locale: fi-FI (fi_FI)
Comment 6 Cor Nouws 2016-04-21 20:44:16 UTC
still not perfect in daily master 20160420

but much better then in 3.3.4
Comment 7 Telesto 2016-12-07 10:19:48 UTC
Still reproducible  with:
Version: 5.4.0.0.alpha0+
Build ID: 2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf
CPU Threads: 4; OS Version: Mac OS X 10.12.1; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-11-29_01:04:44
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 8 QA Administrators 2017-12-08 08:06:28 UTC Comment hidden (obsolete)
Comment 9 NISZ LibreOffice Team 2019-10-11 09:27:12 UTC
This got better in 6.2 with:

https://gerrit.libreoffice.org/plugins/gitiles/core/+/49ddaad2f3ba4e17e1e41e94824fb94468d2b680


author
Justin Luth <justin_luth@sil.org> Wed Jul 25 16:33:47 2018 +0300 
committer
Miklos Vajna <vmiklos@collabora.co.uk> Fri Jul 27 09:45:54 2018 +0200 

tdf#117988 writerfilter: IgnoreTabsAndBlanksForLineCalculation

But that was recently reverted so the images from the top of the second page again appear at the bottom of the first one.
Comment 10 NISZ LibreOffice Team 2019-10-11 09:34:30 UTC
Created attachment 154931 [details]
Screenshot of the document in Writer master and Word

Version: 6.4.0.0.alpha0+ (x86)
Build ID: 489eef894e7034873ad262f9dfca554022db1b09
CPU threads: 4; OS: Windows 6.3; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-10-01_23:43:38
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: CL
Comment 11 Xisco Faulí 2019-10-28 16:13:58 UTC
(In reply to NISZ LibreOffice Team from comment #9)
> This got better in 6.2 with:
> 
> https://gerrit.libreoffice.org/plugins/gitiles/core/+/
> 49ddaad2f3ba4e17e1e41e94824fb94468d2b680
> 
> 
> author
> Justin Luth <justin_luth@sil.org> Wed Jul 25 16:33:47 2018 +0300 
> committer
> Miklos Vajna <vmiklos@collabora.co.uk> Fri Jul 27 09:45:54 2018 +0200 
> 
> tdf#117988 writerfilter: IgnoreTabsAndBlanksForLineCalculation
> 
> But that was recently reverted so the images from the top of the second page
> again appear at the bottom of the first one.

Unfortunately, it was reverted later on in https://git.libreoffice.org/core/commit/202bee1a819de7b1e8c75dd863c4154f66419400

@Justin, is this another dupe of bug 127368 ?
Comment 12 Justin L 2019-10-30 10:51:43 UTC
It looks like the spacing problem is related to the 4th paragraph below "Front Light Bar" which contains a single tab character. LO minimizes the height of that line.
<w:pPr>
  <w:rPr>
    <w:sz w:val="48"/>
  </w:rPr>
</w:pPr>
...
<w:r w:rsidRPr="006D203C">
  <w:rPr><
    <w:sz w:val="40"/>
  </w:rPr>
  <w:tab/>
</w:r>

So yes, it looks like a duplicate of bug 127368. So how is the height of an empty paragraph retained? That should be the key to solving this problem.

*** This bug has been marked as a duplicate of bug 127368 ***
Comment 13 Justin L 2019-11-01 09:23:40 UTC
Somehow the Character properties do not exist in the paragraph attributes for non-empty paragraphs. Is there some kind of "merging" or throwing away of attributes from the paragraph?

Here is the difference between node 74 (just a CR) and node 75 (the line identified in comment 12 with the tab in it).

sw/source/core/text/frmform.cxx:1797: ::Format frame FormatEmpty[0] StrLen[0] text[]
sw/source/core/text/frmform.cxx:1697: ::Format_ empty lines do not get tortured for very long
sw/source/core/text/redlnitr.cxx:344: ::InitFontAndAttrHandler calls Init with pAttrSet[0x55555a7b8ab0] which should contain para nd[74] defaults...
sw/source/core/text/atrstck.cxx:302: ::Init m_pFnt[0] with rFnt height[240], adds attributes if[0x55555a7b8ab0][1]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[90] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[126] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[127] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[8] isChrAttr[1]
sw/source/core/text/atrstck.cxx:602: ::SetSize changing height from[0x240] to [480]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[23] isChrAttr[1]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[28] isChrAttr[1]
sw/source/core/text/atrstck.cxx:311: +++of[7] nWhich[64] isChrAttr[0]
sw/source/core/text/atrstck.cxx:323: xxx after attributes init font size[480]

sw/source/core/text/frmform.cxx:1797: ::Format frame FormatEmpty[0] StrLen[1] text[	]
sw/source/core/text/redlnitr.cxx:344: ::InitFontAndAttrHandler calls Init with pAttrSet[0x55555aa3e780] which should contain para nd[75] defaults...
sw/source/core/text/atrstck.cxx:302: ::Init m_pFnt[0] with rFnt height[240], adds attributes if[0x55555aa3e780][1]
sw/source/core/text/atrstck.cxx:311: +++of[4] nWhich[90] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[4] nWhich[126] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[4] nWhich[127] isChrAttr[0]
sw/source/core/text/atrstck.cxx:311: +++of[4] nWhich[64] isChrAttr[0]
sw/source/core/text/atrstck.cxx:323: xxx after attributes init font size[240]