Bug 130167 - Fileopen DOCX: Image from header section from page 2 shown also on page 1
Summary: Fileopen DOCX: Image from header section from page 2 shown also on page 1
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.0.0
Keywords: bibisected, bisected
: 70986 127052 (view as bug list)
Depends on:
Blocks: DOCX-Header-Footer DOCX-Section
  Show dependency treegraph
 
Reported: 2020-01-24 10:02 UTC by Timur
Modified: 2021-07-12 12:21 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2020-01-24 10:02:07 UTC
Open DOCX attachment 117142 [details] from bug 92642 and see that header from 2nd page (Header - Section 2) is shown also on 1st page.
This docx is compatible mode, but same is if resaved in MSO.
We have a few inherited bugs with header sections but this one looked good in LO 4.0 so I'll mark regression from 4.2.
Attachment 157392 [details] is comparison between Word 2013 and Libreoffice 6.5+.
Comment 1 Timur 2020-01-24 12:50:58 UTC Comment hidden (me-too)
Comment 2 Timur 2020-01-24 12:53:42 UTC
Actually, even in LO 4.0 header wasn't correct, it just wasn't shown on 1st page. So I won't set regression. But bibisect would still be useful.
Comment 3 Dieter 2020-01-25 06:06:18 UTC
I confirm it with

Version: 6.5.0.0.alpha0+ (x64)
Build ID: 350d25da375f221edfa37309324ce3c68cf297ef
CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-GB
Calc: threaded

To be precixe, it's not the whole header but only the image "Picture 3" from the header, that appears as "Piture 2" on page one. Text Box 1 "Page 2" from header on second page doesn't appear in first page header.
Comment 4 Aron Budea 2020-02-01 09:19:59 UTC
This started with the following commit, bibisected using repo bibisect-42max. Note that the document has a continuous section break on the first page, which is unsupported in Writer, therefore complete compatibility is unlikely, but perhaps it can be improved. Adding CC: to Miklos Vajna.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=782adba4d436c65cdf85d48f28486321873b15ed
author		Adam Co <rattles2013@gmail.com>	2013-06-12 15:06:42 +0300
committer	Miklos Vajna <vmiklos@suse.cz>	2013-06-19 14:31:38 +0200

fdo#64238: fix for missing footer bug
Comment 5 Timur 2020-02-03 10:46:33 UTC
Issue also seen in DOCX attachment 153533 [details] from bug 127052, per Aron's bibisect.
Seems like author is not active from 2013. I'll be free to add here Miklos, who is committer and Justin, who tracks a lot of similar issues.
Comment 6 Justin L 2020-02-03 19:14:04 UTC
For "Letterhead-wrong-import-in-LO.docx", the second header's image appears to be imported into the body of the message. (When you delete the header, it doesn't disappear from the first page.)

The same idea is true for the header in "image in header.docx", which doesn't have a continuous section. So the good news is that this doesn't seem to be related to continuous sections. But what is different about these documents compared to other headers/footers containing images? (valid and invalid use of the same image?)

There are other commits indicating that m_bDiscardHeader didn't discard enough.
    git log -p -w 5510f5635021
    git log -p -w da0c3b50c7969

Proposed fix at https://gerrit.libreoffice.org/c/core/+/87909
Comment 7 Commit Notification 2020-02-05 08:08:52 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6d9d4f94e9c0a94bf88d006ba8b157b4cabaeebc

tdf#130167 writerfilter: while bDiscardHeaderFooter, ignore inlines

It will be available in 7.0.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 8 Timur 2020-02-06 12:13:08 UTC
Looks good. Thanks Justin.
Comment 9 Justin L 2020-02-10 16:35:31 UTC
*** Bug 127052 has been marked as a duplicate of this bug. ***
Comment 10 Justin L 2021-07-12 12:21:42 UTC
*** Bug 70986 has been marked as a duplicate of this bug. ***