Bug 142114 - TOC doesn't take into account hidden characters, that are visible as formatting marks
Summary: TOC doesn't take into account hidden characters, that are visible as formatti...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2021-05-06 08:48 UTC by temporary2017
Modified: 2023-05-22 15:11 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Document which demonstrates the bug (9.67 KB, application/vnd.oasis.opendocument.text)
2021-05-06 08:48 UTC, temporary2017
Details
Screenshot of the document - ensure that your settings makes it looking like this (81.05 KB, image/png)
2021-05-21 15:04 UTC, temporary2017
Details

Note You need to log in before you can comment on or make changes to this bug.
Description temporary2017 2021-05-06 08:48:30 UTC
Created attachment 171677 [details]
Document which demonstrates the bug

I have a a document with a table of contents, some chapters and some paragraphs with hidden text. In the LibreOffice Writer settings, hidden text is set to be NOT printed.

Chapter 2 e.g. sits on page 2 when I edit the document in writer, because the hidden text is shown.

When  I view the document in print preview, when I print the document or when I export the document to PDF, chapter 2 sits on page 1, because the hidden text is NOT shown.

However, the page numbers in the TOC do not reflect this difference. The TOC keeps showing chapter 2 on page 2, regardless of the current mode (edit, print preview, print, PDF export).

And there seems to be no way to tell the TOC to reflect the chapter page numbers when hidden text is NOT shown.

See the attached document as an example for this behaviour.
Comment 1 Dieter 2021-05-21 06:45:16 UTC
I can't confim it with

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 1675a68526c43c6c6e4dc850ee911f0c1de75c88
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

I opened attachment 171677 [details] => in TOC chapter 2 is on page 2
Update index => in TOC chapter 2 is on page 1
Export to PDF => in TOC chapter 2 is on page 1
Comment 2 temporary2017 2021-05-21 15:04:24 UTC
Created attachment 172234 [details]
Screenshot of the document - ensure that your settings makes it looking like this
Comment 3 temporary2017 2021-05-21 15:10:13 UTC
Dieter, when you open the document, is Header 2 on page 2?
Do you see the paragraphs with hidden blue 'a's?

If not, then you have to make the hidden text visible on your screen by enabling the option "Hidden characters" which can be found under

Tools | Options | LibreOffice Writer | Formatting Aids | Display Formatting

It is also important to save the document locally. LibreOffice does not apply this change when the document is opened right from the download - at least on my computer.

Note, that the above option makes the hidden text visible on the screen only. It remains hidden in the PDF, in the print preview and in the printout. Hence, the TOC should react accordingly to this difference.
Comment 4 Dieter 2021-05-21 17:06:37 UTC
(In reply to temporary2017 from comment #3)
> Dieter, when you open the document, is Header 2 on page 2?
> Do you see the paragraphs with hidden blue 'a's?

Thanks for screenshot. It's always good, to provide detailed steps to reproduce

1. Open attachment 171677 [details]
2. Make sure, that hidden characters are displayed (Tools => Options => LibreOffice Writer => Formatting Aids
3. Update index(perhaps not necessary)
4. Export to PDF

Actual result: In PDF page number of chapter 2 is "2", although it is part of page 

I'm not a developer, so I'm not sure, if it is possible that TOC takes into account hidden characters. So perhaps a WONTFIX, but let's ask developers

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 1675a68526c43c6c6e4dc850ee911f0c1de75c88
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 5 QA Administrators 2023-05-22 03:15:09 UTC Comment hidden (obsolete)
Comment 6 temporary2017 2023-05-22 15:11:46 UTC
Bug still present in Version: 7.5.3.2 (X86_64).