Bug 131194 - TOC ignores the page-number offset
Summary: TOC ignores the page-number offset
Status: RESOLVED DUPLICATE of bug 35694
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: TableofContents-Indexes Fields-Page-Number
  Show dependency treegraph
 
Reported: 2020-03-07 01:53 UTC by TorrAB
Modified: 2022-10-16 10:58 UTC (History)
1 user (show)

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


Attachments
file with pages 0, 1, … (17.84 KB, application/vnd.oasis.opendocument.text)
2020-03-07 01:56 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-03-07 01:53:47 UTC
Description:
In file pages03.odt, pages are numbered from 0, with a page-number offset=-1, but the TOC ignores this offset and shows numbers as 2, 3, 4 instead of 1, 2, 3.


Steps to Reproduce:
1.make a multi-page doc, with a Heading2 in each page
2.insert a page number in header.
3.edit (R-click) the field page-number, set its offset=-1
4.insert a TOC, which list all Heading2's and their page-numbers —wrong, without offset.

Actual Results:
TOC shows page-numbers without offset

Expected Results:
TOC should show page-numbers as they appear in header.


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 TorrAB 2020-03-07 01:56:49 UTC
Created attachment 158459 [details]
file with pages 0, 1, …
Comment 2 Dieter 2020-03-07 08:56:48 UTC
I confirm it with

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

I think, problem is a little bit broader. If I insert a cross reference and insert reference to page, I recieve the same wrong result.
Comment 3 Mike Kaganski 2022-10-15 12:33:11 UTC
This is not a bug.

> In file pages03.odt, pages are numbered from 0, with a page-number offset=-1

This implied that pages were numbered by the page number fields that were put to the headers. This is wrong. Pages are numbered not by any fields, but either automatically (from 1), or as a property of a page break (actually, a property of paragraph).

The page offset is used not to change page numbers, but as a means to refer to some other page, like "two pages before", or "next page". It is even documented on the respective help page [1]:

> If you want to change the actual page number and not the displayed number, do
> not use the Offset value. To change page numbers, read the Page Numbers guide.

[1] https://help.libreoffice.org/7.4/en-US/text/swriter/01/04090001.html?DbPAR=WRITER#bm_id3150903
Comment 4 TorrAB 2022-10-15 14:52:45 UTC
(In reply to Mike Kaganski from comment #3)

Your theoretical, convoluted and abstruse explanation may satisfy some LibreOffice designer, but it escapes me and, obviously, any reader, who should somehow understand that page 13 in the TOC really means page 12 in the document! The reader does not know or care about an ‘actual page number’ and a ‘displayed number’; he|she just sees a page number in the TOC, another in a header, and they should be equal. This is not ‘wrong’.
The LibreOffice design may use an internal page number (unknown to the author or the reader) that always starts at 1, but numbers displayed in the TOC and the text should be consistent and include the offset, which belongs to the document format chosen by the author.
Comment 5 Mike Kaganski 2022-10-15 16:05:54 UTC
You asically put a random number into a header (which you defined as 'page number minus one), and declared it "page number"). You also could just type "42" there in the header directly, and expect ToC to show that as the page number.

If you don't see why a field does not define a page number: just copy that page number near the first, and in the second one, replace offset from -1 to +2. Now you have two different arbitrary numbers in the header; which should appear in ToC?

Please acknowledge that if user does not understand something, it's not *always* a bug: sometimes one needs to learn the tool.
Comment 6 Mike Kaganski 2022-10-15 16:40:50 UTC

*** This bug has been marked as a duplicate of bug 35694 ***
Comment 7 Dieter 2022-10-16 10:47:14 UTC
(In reply to Mike Kaganski from comment #5)
> You asically put a random number into a header (which you defined as 'page
> number minus one), and declared it "page number"). You also could just type
> "42" there in the header directly, and expect ToC to show that as the page
> number.

Mike, I disagree from a user perspective. We have a field called "page number". And you explain, that it is not the page number, but "a random number into the header"?

But I agree, that problem in docment is caused by using page offset. If you use the way, that is documented in LO help [1], result is the expected one.

[1] https://help.libreoffice.org/7.5/en-GB/text/swriter/guide/pagenumbers.html?&DbPAR=WRITER&System=WIN
Comment 8 Mike Kaganski 2022-10-16 10:58:16 UTC
(In reply to Dieter from comment #7)
> We have a field called "page
> number". And you explain, that it is not the page number, but "a random
> number into the header"?

Yes.
OP considered it to be "set / define page number". It would be better named "*show* page number of a page relative to current". In case when you don't use an offset, it's equivalent to "*show* current page number". But in no case it is "define page number", and is just a label. So no different from any random number inserted into this position.