Bug 137608 - Maximum page number of 9999 when inserting a manual break with custom page number
Summary: Maximum page number of 9999 when inserting a manual break with custom page nu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.1.0 target:7.0.3
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-19 23:47 UTC by deko.meister.dawg
Modified: 2020-10-21 13:42 UTC (History)
1 user (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 deko.meister.dawg 2020-10-19 23:47:11 UTC
Description:
Maximum page number of 9999 when inserting a manual break with custom page number. Page numbers above 9999 selected result in a page number of 9999 being used instead with no warning to user.

Certain document specifications (e.g. ATA spec 100) require custom page numbers to cover different sections. These custom page numbers may exceed 10000. Documents according to these specifications cannot be correctly written using LibreOffice Writer using automatic page numbering.

Steps to Reproduce:
1. Create new document
2. Add page number to footer (first page will be page 1)
3. Insert->Manual Break->Change Style to Default->Tick Change Page Number->Enter any number 10000 or above->Click OK
4. Look at page number on new page

Actual Results:
New page will have a page number of 9999 regardless of number entered. Subsequent pages increment normally above 10000.

Expected Results:
New page will have page number set by user (i.e. that is greater than 9999).


Reproducible: Always


User Profile Reset: No



Additional Info:
If this is number is a hardcoded limit, as a temporary workaround it would be suitable to increase the limit to a larger number (>40k). This would cover the ATA spec 100 use case.

A pop-up message could also be added to inform the user that there are limits associated with this number entry field.
Comment 1 Mike Kaganski 2020-10-20 05:24:03 UTC
Repro with Version: 7.0.2.2 (x64)
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 12; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

The limit is obviously arbitrary.
Comment 2 Mike Kaganski 2020-10-20 05:48:55 UTC
Also reproducible with OpenOffice.org 3.2.0 OOO320m12 (Build:9483).
Comment 3 Caolán McNamara 2020-10-20 08:34:23 UTC
writer is using sal_uInt16 for the page number which suggests we could allow a max value of 65535. If we wanted anything bigger then we need to make real changes to writer to bump up the type. Leaving the type as sal_uInt16 but allowing 65535 then makes it real easy to use the ui to force writer to loop over to page 0 and I can already hear the moaning of "regressions" already. So I propose instead of an arbitrary 10000-1 to have 65535 - arbitrary 10000 for a max of 55535 instead
Comment 4 Commit Notification 2020-10-20 14:10:49 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/39b1a14b85ec1a0616a08a49f1be16f91a8e7f82

tdf#137608 allow insert break to use a page number > 9999

It will be available in 7.1.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 5 Mike Kaganski 2020-10-20 14:16:43 UTC
Nice; note that paragraph (style) properties dialog also has this limit on text flow tab :-)
Comment 6 Caolán McNamara 2020-10-20 14:37:11 UTC
https://gerrit.libreoffice.org/c/core/+/104566 for the equivalent textflow ones
Comment 7 Commit Notification 2020-10-20 18:21:30 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f33c634a5b2f4ee010dd72f91128a445ef95d222

Related: tdf#137608 use same max-page in textflow as insert, break

It will be available in 7.1.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 Caolán McNamara 2020-10-20 18:22:40 UTC
fixed in master, backport of the two above commits for 7-0 submitted to gerrit
Comment 9 Commit Notification 2020-10-21 13:42:22 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/af580166b64e1009eb76b750d7cb92121f994d08

tdf#137608 allow insert break to use a page number > 9999

It will be available in 7.0.3.

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.