Bug 138348 - FILEOPEN DOCX Wrong decimal precision and result displayed initially in equations
Summary: FILEOPEN DOCX Wrong decimal precision and result displayed initially in equat...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: DOCX-Fields
  Show dependency treegraph
 
Reported: 2020-11-19 18:18 UTC by Buovjaga
Modified: 2020-11-20 09:57 UTC (History)
2 users (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 Buovjaga 2020-11-19 18:18:56 UTC
1. Open attachment 161593 [details] from bug 133647
2. Click in Row two or Row total cells with formula fields

Observe the values change to the expected ones.

Bibisected with linux-64-7.1 to
https://git.libreoffice.org/core/commit/1abf4e6d07ca0ac31bc54f812df84efc82d2af1b
DOCX import: don't throw away cached value of SwHiddenTextField ...

Adding Cc: to Miklos Vajna
Comment 1 Aron Budea 2020-11-20 00:53:47 UTC
What is actually the problem here?
If I open the file in a recent LO master build, I see values 429.545454545455 in Row two, and 877.001253966275 in Row total, however if I open the file in Word 2013, I see the exact same values.

Clicking into one of the fields in Writer yields 429.55 and 877 (both are recalculated, though the file doesn't become modified), while updating each field in Word yields 430 and 877.
I'd see that as a minor discrepancy, but as I understand, that's not what was reported.
Comment 2 Buovjaga 2020-11-20 06:38:24 UTC
(In reply to Aron Budea from comment #1)
> What is actually the problem here?
> If I open the file in a recent LO master build, I see values
> 429.545454545455 in Row two, and 877.001253966275 in Row total, however if I
> open the file in Word 2013, I see the exact same values.
> 
> Clicking into one of the fields in Writer yields 429.55 and 877 (both are
> recalculated, though the file doesn't become modified), while updating each
> field in Word yields 430 and 877.
> I'd see that as a minor discrepancy, but as I understand, that's not what
> was reported.

Clicking into one of the fields yields 429.55 and 549.55 in Writer for me.

I don't know what is the problem or if it is a problem. I just reported a change and behaviour that seemed weird to me.
Comment 3 Miklos Vajna 2020-11-20 07:46:07 UTC
I think the expected behavior is that we keep the cached values of fields and only recalc them if the user asks for it. My understanding is that this is what Word does, too.

The change in behavior is that we used to throw away the cached value and now we try harder to keep it. In this case we still recalc it in an idle handler, though. This sounds like a step in the right direction. (Ideally we should not do that recalc at all, at least not automatically.)

Unless I miss something, this is working as intended and is not a bug.