Bug 59293 - FILEOPEN: .ods: error values in array formula result not preserved when cached
Summary: FILEOPEN: .ods: error values in array formula result not preserved when cached
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta2
Hardware: All All
: medium major
Assignee: Markus Mohrhard
QA Contact:
URL:
Whiteboard: target:4.1.0 target:4.0.0.2
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-01-12 20:17 UTC by Eike Rathke
Modified: 2013-01-15 18:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Rathke 2013-01-12 20:17:08 UTC
Similar to bug 59039 when loading an .ods document with an array formula that in one of it's cells has an error result, that result is not preserved until the formula is recalculated. Steps to reproduce:

1. A1: 1
2. A2: =1/0
3. enter array formula in A3:A4 {=A1:A2}
   => result in A4 is #DIV/0!
4. save as .ods
5. reload
6. notice error in A4 is displayed left justified as string
7. in some cell enter =ISERROR(A4)
   => result FALSE, should be TRUE
Is correct only after formula in A3:A4 was forced to recalculate, e.g. Ctrl+F9
Comment 1 Jorendc 2013-01-12 21:49:09 UTC
@Eike: Because Markus is already assigned, I suppose this behavior is already tested and confirmed. Can we set this bug as NEW if so? Or do you want an independent test for this bug?

Kind regards,
Joren
Comment 2 Eike Rathke 2013-01-12 22:20:05 UTC
@Joren: Just forgot to set to New, done.

@Markus,Kohei: side note: no, this is not fixed with b6fbc8642928893ca608a35b802032cfe42e40bb / 97a10ade202537a60bf15ad58f2e44cfb785bb3f from bug 58539
Comment 3 Markus Mohrhard 2013-01-14 07:21:57 UTC
Ok, we have several unrelated bugs here with the matrix handling that add together to a lot of nasty behavior.

First thing is that matrix formula cells are not registered in the formula tree.
Fixing that shows another bug because we are setting the formula string for CompileXML which means we have no access to the real ScTokenArray during import wich we would need for the ScFormulaCell::StartListeningTo call. And finally there is the here mentioned problem of error string handling in formula cells which needs a fix for the other two bugs first.

I have already a fix for the missing calls to StartListeningTo, but the problem with storing the formula string instead of the token array needs a bit of inspection. I hope that we can just skip the problem in ScMyTables::AddMatrixRange and compile the formula already to a normal ScTokenArray.
Comment 4 Not Assigned 2013-01-15 04:24:42 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7f4269b9798c348b1ede4ad0d777f6a0977b7e16

for error value in matrix force recalc, fdo#59293



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Markus Mohrhard 2013-01-15 04:27:23 UTC
I finally went a little bit different road. We are now forcing a recalculation of the matrix if it contains a possible error value. We might try to switch in the future to only forcing a recalculation of the cells with error values but we need to fill the ScMatrix for this manually with values.
Comment 6 Not Assigned 2013-01-15 13:28:11 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=143c102df00d8ae84094ffd13454dffaa6fc6c7a&h=libreoffice-4-0

for error value in matrix force recalc, fdo#59293


It will be available in LibreOffice 4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Not Assigned 2013-01-15 18:15:50 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d81787416087827200ee12a8fbd25747fbfc3959

add test case for fdo#59293



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.