Bug 121799 - When calling LibreOffice in server mode to update the TOC of a large document, the page numbers in the TOC are wrong
Summary: When calling LibreOffice in server mode to update the TOC of a large document...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
5.1 all versions
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-29 11:03 UTC by Gaëtan Delannay
Modified: 2019-08-19 07:08 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 Gaëtan Delannay 2018-11-29 11:03:58 UTC
Description:
Context: I am the developer of appy.pod, a Python library using LibreOffice in server mode via UNO (http://appyframework.org/pod.html). appy.pod allows to define "ODT templates" being ODT documents misusing fields and notes by filling them with Python code. Such a template is pre-processed by appy.pod, and the result, a "pure" ODT document, is then sent to LibreOffice via UNO to apply some changes, like recomputing the table of contents and indexes, optimizing tables columns widths, resolving sections tied to other ODT documents, etc.

A large ODT document (between 100 and 300 pages) is loaded by LibreOffice via UNO. Then, appy.pod asks via UNO to update the table of contents, then to save the result on disk.

The table of contents contains wrong page numbers. For instance, if the document is made of 130 pages, the table of contents will be complete, but page numbers besides titles will range from 1 to 80.

Steps to Reproduce:
1. Create a pod template with appy.pod, containing a table of contents.
2. Call appy.pod Renderer to create a large file based on this template (between 100 and 300 pages)
3. Ask LibreOffice via UNO to update the table of contents
4. Ask LibreOffice to save the result on disk.

Actual Results:
Within the table of contents, sometimes, the page numbers besides the titles are wrong.

Expected Results:
Within the table of contents, the page numbers besides the titles should correspond to the actual pages where titles lie.


Reproducible: Sometimes


User Profile Reset: No



Additional Info:
It seems that LibreOffice, when loading an ODT document, be it via UNO or the graphical user interface (GUI), does not load it at once, completely. I suppose this is a feature allowing the user to start manipulating the partially loaded document, while the remaining is loaded in the background. Indeed, I observed that, when loading a large document via the GUI, the page counter (in the bottom left corner) indicates a wrong number of pages. After a while, this counter increments itself until it reaches the correct page number.

This behaviour has been observed on LibreOffice 5.1 and 6.1.3~rc2-0ubuntu0.18.04.2.

I suppose that this mechanism may be responsible for producing wrong page numbers, as explained hereafter, and could maybe explain bug #121796 also reported by myself.

1. LibreOffice loads the document via UNO, but partially (let's say, the first 80 pages)
2. The UNO command for updating the table of contents is executed at this moment: the table of contents contains wrong numbers, from 1 to 80.
3. After a while, the remaining of the document is loaded and saved to disk, but includes a table of contents containing wrong page numbers.
Comment 1 Xisco Faulí 2019-01-14 17:08:45 UTC
Thank you for reporting the bug.
it seems you're using an old version of LibreOffice.
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 2 QA Administrators 2019-07-14 02:48:49 UTC Comment hidden (obsolete)
Comment 3 QA Administrators 2019-08-19 07:08:22 UTC
Dear Gaëtan Delannay,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp