Bug 74328 - FORMATTING: Pagination resets if starting page above 255 in MS Word DOC/XML documents
Summary: FORMATTING: Pagination resets if starting page above 255 in MS Word DOC/XML d...
Status: RESOLVED 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: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords:
: 44350 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-02-01 16:27 UTC by Mr Yum
Modified: 2020-10-13 09:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
test doc in ODF with starting page at 256 (85.58 KB, application/vnd.oasis.opendocument.text)
2014-02-01 17:00 UTC, Jean-Baptiste Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mr Yum 2014-02-01 16:27:21 UTC
For documents saved in the MS Word DOC/XML formats the page numbering resets to 1 whenever the starting page number is set above 255 when set via the following:

Format>Paragraph...>Text Flow>
 ..
 Breaks
  [x] Insert [Type: Page  Position: Before]
  [x] With Page Style [Type: Default Page Number: 255]

Similar behavior is present in documents saved in the RTF and DocBook XML formats.  Lastly, documents saved in the UOT format became completely corrupted.

How to repeat:
1) create a new multi-page MS Word DOC or XML document using default settings
2) modify style of first paragraph on first page as described above, setting
   the starting page number to 255.
3) enable "Footer On" in first page style if needed
4) insert "Page Number" field in footer of first page
5) observe that all document pages display Page Number field in
   footer area and are numbered sequentially starting at 255
6) save and close document
7) reopen document; page numbering should still start at 255
8) modify style of first paragraph on first page again, setting the
   starting page number to 256. Save and close document.
9) reopen document; page numbering has reset, starting at 1

Oddly enough, documents saved in MS Word DOCX format did not appear to suffer from this bug.  This bug has also been found in current stable version of Apache OpenOffice Writer (re: https://issues.apache.org/ooo/show_bug.cgi?id=124032 ).
Comment 1 Mr Yum 2014-02-01 16:38:53 UTC
Tested using "typical" install on Windows XP.

(from Help>About LibreOffice)

Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Comment 2 Jean-Baptiste Faure 2014-02-01 17:00:16 UTC
What do you mean by "MS Word DOC or XML" format ? In the dropdown list of formats when I do File > Save as..., I get "Microsoft Word 2003 XML (.xml)" and "Microsoft Word 97/2000/XP/2003 (.doc)"

That said I did a doc with LibreOffice 4.2.0 (Linux) in OpenDocument (.odt) format starting at page 256 with the page number field in the footer and :
- if I save this document in "Microsoft Word 2003 XML (.xml)", the xml file loose the footer on the first page and the page number on the second one is 2.
- if I save the ODF document in "Microsoft Word 97/2000/XP/2003 (.doc)" the page number in the first page is 0.

So set the status to NEW.
Comment 3 Jean-Baptiste Faure 2014-02-01 17:00:59 UTC
Created attachment 93177 [details]
test doc in ODF with starting page at 256
Comment 4 Joel Madero 2015-05-02 15:42:34 UTC Comment hidden (obsolete)
Comment 5 Mr Yum 2015-05-03 17:44:03 UTC
The bug appears to still be present when saving to the following formats:

MS Word 2003 XML (.xml) **
MS Word 97/2000/XP/2003 (.doc)
MS Word 97/2000/XP/2003 Template (.dot)

** does not even keep footer display changes

Used "test_page256.odt" uploaded by Jean-Baptiste Faure as starting point.

Installed Libreoffice version/build:
Version: 4.4.2.2
Build ID: c4c7d32d0d49397cad38d62472b0bc8acff48dd6
Locale: en_US

Operating System:
% uname -smrvpio
Linux 3.11-2-amd64 #1 SMP Debian 3.11.8-1 (2013-11-13) x86_64 unknown unknown GNU/Linux
Comment 6 Commit Notification 2016-04-28 09:42:47 UTC
Oliver Specht committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5f63e19ddffdf3eaa2351968550498fdae35475d

tdf#74328: loading section page no. as 16 bit unsigned

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Timur 2020-10-13 09:48:18 UTC
*** Bug 44350 has been marked as a duplicate of this bug. ***