Bug 124025 - Table formulas don't update before print, export to PDF or preview when a field changes
Summary: Table formulas don't update before print, export to PDF or preview when a fie...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Samuel Mehrbrodt (allotropia)
URL:
Whiteboard: target:6.3.0 target:6.2.3
Keywords:
Depends on:
Blocks: Writer-Tables-Formulas
  Show dependency treegraph
 
Reported: 2019-03-12 14:18 UTC by Alexander Polkhovskiy
Modified: 2020-04-13 05:21 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
File to reproduce the bug (11.08 KB, application/vnd.oasis.opendocument.text)
2019-03-12 14:19 UTC, Alexander Polkhovskiy
Details
6.1.5 export demo (3.55 MB, video/mp4)
2019-03-13 12:57 UTC, Alexander Polkhovskiy
Details
6.1.5 print demo (4.18 MB, video/mp4)
2019-03-13 12:58 UTC, Alexander Polkhovskiy
Details
6.3.0 export demo (2.05 MB, video/mp4)
2019-03-13 12:58 UTC, Alexander Polkhovskiy
Details
6.3.0 print demo (2.22 MB, video/mp4)
2019-03-13 12:59 UTC, Alexander Polkhovskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Polkhovskiy 2019-03-12 14:18:21 UTC
Description:
Table formulas don't update before print, export to PDF or preview if it has a link to a cell with a field that was changed. Only updates if I put cursor to the table.

Steps to Reproduce:
1. Open the attached file.
2. Press preview, or export it to PDF or print to any printer.
3. Look the 1st cell of the table.

Actual Results:
1st cell's value remains 7.

Expected Results:
1st cell's value should be 22.


Reproducible: Always


User Profile Reset: No



Additional Info:
1st cell uses the sum of the 2nd and 3rd cells, which contains page number of a bookmark "End", which is placed at the end of the document. So, the cell should be 3+19=22, but it still has 3+4=7.
4 is the value of the 3rd cell before some pages of text were inserted - previously bookmark was on the page 4. Then after pasting some text the bookmark appears on the page 19, but the 1st cell doesn't update its formula result. Even on preview, export or printing. Seems that when the field receives a new value it doesn't trigger recalculation.

Ver: 6.2.2.1
ID: fcd633fb1bf21b0a99c9acb3ad6e526437947b01
CPUThreads: 4; OS: Windows 6.3; GL: default; VCL: win; 
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL

The bug appeared in 6.2.2.1 rc or pre-release and reproduced in 6.3.0 alpha.
Version 6.1.2 doesn't have this bug - table recalculates correctly at least on export and print.
Comment 1 Alexander Polkhovskiy 2019-03-12 14:19:16 UTC
Created attachment 149914 [details]
File to reproduce the bug
Comment 2 Durgapriyanka 2019-03-12 17:02:25 UTC
Thanks for reporting the bug. I cannot reproduce the bug, because the cell value changes to 22, once the Preview button is clicked.

Version: 6.3.0.0.alpha0+
Build ID: b6b28931435e44aca92b8c0e1659f701e3ed1a87
CPU threads: 2; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2019-01-30_06:57:04
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 3 Dieter 2019-03-12 20:59:43 UTC
Cell only updates, if I click within the table. I don't know if this is the intended behaviour or not (found it in master as well as in LO 6.1.2.5). So I can't see, that there is a problem with print preview.
Comment 4 Alexander Polkhovskiy 2019-03-13 12:57:49 UTC
Thank you for your fast replies.
(In reply to Dieter Praas from comment #3)
> Cell only updates, if I click within the table. I don't know if this is the
> intended behaviour or not (found it in master as well as in LO 6.1.2.5). So
> I can't see, that there is a problem with print preview.

Exactly - have to click the table to update.
But in
V: 6.1.2.1 (x64)
ID: 65905a128db06ba48db947242809d14d3f9a93fe
threads: 4; OS:Windows 6.3; UI render: default; 
locale: ru-RU (ru_RU); Calc: CL
I get PDF or printed document with the table updated, even if I don't click it.
I made 4 videos to demonstrate. To my mind it is a bug - at least printing should recalculate everything.
Comment 5 Alexander Polkhovskiy 2019-03-13 12:57:57 UTC
Created attachment 149932 [details]
6.1.5 export demo
Comment 6 Alexander Polkhovskiy 2019-03-13 12:58:23 UTC
Created attachment 149933 [details]
6.1.5 print demo
Comment 7 Alexander Polkhovskiy 2019-03-13 12:58:49 UTC
Created attachment 149934 [details]
6.3.0 export demo
Comment 8 Alexander Polkhovskiy 2019-03-13 12:59:08 UTC
Created attachment 149936 [details]
6.3.0 print demo
Comment 9 V Stuart Foote 2019-03-13 15:07:57 UTC
@Samuel, related to bug 121962? And, would table update also be affected by fix for bug 123378 

https://gerrit.libreoffice.org/plugins/gitiles/core/+/ac1b2c9e1ab2f84de3a8856772e00302d237e82f%5E%21
Comment 10 Samuel Mehrbrodt (allotropia) 2019-03-25 10:28:33 UTC
This is a regression probably caused by bug 121962. Still there in current master ( 92037bb5b7c1d47acbd941060173f5a181a6b0c4 ).
Comment 11 Xisco Faulí 2019-03-27 14:52:20 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/055480aac88e4688619e9a7815e0a8b0ab97a5a1%5E%21

tdf#124025 Update formula before printing

It will be available in 6.3.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 12 Xisco Faulí 2019-03-27 14:56:48 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/97ff2b5fb8d3f6812c7d2f0a59d1accbff03c468%5E%21

tdf#124025 Update formula before printing

It will be available in 6.3.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 13 Alexander Polkhovskiy 2019-04-03 14:41:55 UTC
The buf is not reproduced in
Version: 6.3.0.0.alpha0+ (x64)
Build ID: cc9a8c13dad6f3d82a2386554bd6113b486a1752
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-04-03_00:59:49
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: CL

Thank you for fixing! (o.o)-b