Bug 108970 - DOCX IMPORT: page number is absent in specific document's footer
Summary: DOCX IMPORT: page number is absent in specific document's footer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:docx
Depends on:
Blocks: Writer-Header-Footer DOCX
  Show dependency treegraph
 
Reported: 2017-07-05 13:25 UTC by Mike Kaganski
Modified: 2020-06-23 14:50 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
A test file with 2 pages with page numbers in footers' paragraph-attached text boxes (44.73 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-07-05 13:25 UTC, Mike Kaganski
Details
Minimal testcase with inherited footer with text box (2.65 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-07-05 15:32 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2017-07-05 13:25:18 UTC
Created attachment 134492 [details]
A test file with 2 pages with page numbers in footers' paragraph-attached text boxes

Attachment has page number in text box in each of two pages in Word.
When open in Writer, it only has page number in 1st page, the second page has empty footer.

The problem is that the second section in document inherits the footer from first section, so LibreOffice copies the footer data between page styles on import (SectionPropertyMap::CopyLastHeaderFooter), and the functions that do real job (DocumentContentOperationsManager::Copy[Range|Impl]) do not copy last paragraph's anchored objects.
Comment 1 Mike Kaganski 2017-07-05 15:32:13 UTC
Created attachment 134496 [details]
Minimal testcase with inherited footer with text box

This is a better sanitized example.
Comment 2 Xisco Faulí 2017-07-10 17:21:04 UTC
Confirmed in

Version: 6.0.0.0.alpha0+
Build ID: 7931ef2abbcef22de5cdddd26738e4dd8d1d8ca5
CPU threads: 4; OS: Linux 4.8; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

and

Version: 4.4.0.0.alpha0+
Build ID: f340f0454627939f1830826fb5cc53a90e6c62a4

in previous version, the footer is not even displayed on the first page.
Comment 3 Justin L 2017-11-08 11:46:25 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2018-11-09 03:59:28 UTC Comment hidden (obsolete, spam)
Comment 5 Timur 2020-01-06 19:15:45 UTC
Repro 6.5+.
Comment 6 Justin L 2020-03-07 05:47:18 UTC
In reply to Justin L from comment #3)
> Sounds similar to bug 104237 
attachment 134492 [details] still not fixed in master 7.0, not even by bug 112202
Comment 7 Timur 2020-06-23 12:27:03 UTC
Looks OK, WFM, rebisect desired (I came up with that word to stand for reverse bibisect, should be in LO nerd's dictionary).
Comment 8 Justin L 2020-06-23 13:05:15 UTC
fixed by commit c12358166a9bd88fe10feabca45a6ad3f65dff8e
Author: Miklos Vajna on Fri Jan 10 16:03:43 2020 +0100

    DOCX import: fix lost objects anchored to an empty linked header
    
    This is really similar to commit
    04b2310aaa094794ceedaa1bb6ff1823a2d29d3e (DOCX import: fix lost objects
    anchored to the single para of a linked header, 2020-01-10), except here
    the header is not just a single-paragraph one, but has no text portions.
    
    Update text-copy.docx to have a header which is not only a single
    paragraph, but also has no character content. This keeps testing the
    original case, but now also tests the more strict case (single paragraph
    -> single empty paragraph).