Bug 160238 - FORMATTING - "Paragraph style" - "Text Flow" - "Breaks": incorrect "Page number"
Summary: FORMATTING - "Paragraph style" - "Text Flow" - "Breaks": incorrect "Page number"
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Paragraph Fields-Page-Number
  Show dependency treegraph
 
Reported: 2024-03-17 07:25 UTC by mc.wikipediano
Modified: 2024-12-03 18:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file with wrong page numbers (9.32 KB, application/vnd.oasis.opendocument.text)
2024-03-23 05:26 UTC, mc.wikipediano
Details
Wrong page numbers 3 (7 expected) and 4 (10 expected) (25.51 KB, image/jpeg)
2024-03-23 05:29 UTC, mc.wikipediano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mc.wikipediano 2024-03-17 07:25:14 UTC
Description:
When creating or editing a paragraph template and setting a page number in "Text Flow" / "Breaks", an incorrect page number is shown using "Page number" field.

Using "Format" - "Paragraph" - "Text Flow" tab, the page number is shown correctly.

Steps to Reproduce:
1. Create a new paragraph style and in "Text Flow" / "Breaks" check "Insert" with
"Type" = "page", set a Page Style and set "Page Number" to a number N
2. Apply this template to a paragraph

Actual Results:
If the number N is even, an even number is shown (but not necessarily the number N), otherwise an odd number is shown

Expected Results:
The number N should be shown as the page number of the new page


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: it-IT (it_IT); UI: it-IT
Calc: threaded
Comment 1 wjsim 2024-03-22 16:07:32 UTC
Thank you for reporting the bug. 

I'm not able to reproduce this as I'm not quite sure what to look out for. Could you please provide a screenshot and a file demonstrating the bug?

If the number N is even, an even number is shown where?

I found that if I created 3 pages, and applied the steps to reproduce and set the number N to 8, it considers page 3 as page 4.

Tested with:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6a064b1967e06e40be40817deff99d00c1a8554f
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: ko-KR (en_US); UI: en-US
Calc: CL threaded

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 2 mc.wikipediano 2024-03-23 05:26:43 UTC
Created attachment 193252 [details]
Test file with wrong page numbers
Comment 3 mc.wikipediano 2024-03-23 05:29:22 UTC
Created attachment 193253 [details]
Wrong page numbers 3 (7 expected) and 4 (10 expected)
Comment 4 mc.wikipediano 2024-03-23 05:38:06 UTC
I've attached an ODT file and an image to illustrate the problem I'm having: the page number doesn't match the expected number when applying a paragraph style that sets the page number.
Using the "A Set Page 7" style on the second page results in the page numbered "3" instead of "7"; using the "A Set Page 10" style on the next page, the page is treated as numbered "4" instead of "10".
Comment 5 Haris 2024-04-02 06:02:11 UTC
I was able to reproduce the bug using the test file you provided. I also encountered similar behavior when I reproduced the steps provided. An even page number only shows an even number N and an odd page number only shows an odd number N. If a page number is odd/even and the number is even/odd, the page number goes back a page. For example, when I tried changing page 11 to page 12, the page number changed to page 10 instead. Everything was tested on MacOS Sonoma 14.1.2 running on my M2 Pro Chip MacBook Pro.

These are the two builds I used:

Stable Build
Version: 24.2.2.2 (AARCH64) / LibreOffice Community
Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01
CPU threads: 10; OS: macOS 14.1.2; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Master/Daily Build
Version: 24.8.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: c4023d3ec604abfff38be2053e2989c7ec2ba8c1
CPU threads: 10; OS: macOS 14.1.2; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 Buovjaga 2024-12-03 18:40:29 UTC
This is intentional, but see bug 153259.

Quoting some comments from the dev chat:
"expected behaviour - in print a work with a change from an odd to an odd page number will have an empty page in between, and that is usally counted in the total number"

"in Writer, between two odd pages, there will always be an even one (maybe automatic blank); same between two even pages."