Bug 51664 - FILEOPEN .xls with matrix {row()} returns error message instead of result
Summary: FILEOPEN .xls with matrix {row()} returns error message instead of result
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:3.7.0 target:3.6.0.1
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-07-02 13:14 UTC by Valek Filippov
Modified: 2012-07-05 11:49 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
file with a problem (16.50 KB, application/vnd.ms-excel)
2012-07-02 13:14 UTC, Valek Filippov
Details
Screenshot from XL2003 (36.17 KB, image/png)
2012-07-02 13:15 UTC, Valek Filippov
Details
Simplyfied Sample (7.00 KB, application/vnd.ms-excel)
2012-07-03 05:51 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valek Filippov 2012-07-02 13:14:06 UTC
Created attachment 63721 [details]
file with a problem

Cells B14 to B17 don't seem to be imported properly.

Works fine in 3.5.3, doesn't work in 3.6b2
Comment 1 Valek Filippov 2012-07-02 13:15:09 UTC
Created attachment 63722 [details]
Screenshot from XL2003
Comment 2 Rainer Bielefeld Retired 2012-07-02 23:32:11 UTC
@Valek Filippov
Please contribute more precise information. "Doesn't seem ...  properly" is not very useful.
Comment 3 Valek Filippov 2012-07-03 05:01:25 UTC
2Rainer:
open it in LO 3.5, gnumeric, XL or XL Viewer and compare.
Comment 4 Rainer Bielefeld Retired 2012-07-03 05:49:11 UTC
[Reproducible] with reporter's sample and "LibreOffice  3.5.5.2.  German UI/Locale [Build-ID: 24b32b4-b87ec2e-85c8e98-87a4e20-9a1b8c1] on German WIN7 Home Premium (64bit) 

Steps how to reproduce with parallel installation of Master "LOdev " 3.7.0.0.alpha0+   - WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 3985521]" (tinderbox: W2008R2@16-minimal_build, pull time 2012-06-24)

1. open new CALC document from LibO Start Center
2. Select B10:B20
3. Type "=row()"
   > will show "row()" function in B10
4. <control+shift+Enter>
   Creates matrix {row()} for B10:B20, showing row number
5. Save as "sample.ods"
6. Save as "sample.xls" (MSO97)
7. Close all documents
8. Open both "sample.xxx" documents (one by one)
   Bug: in "sample.xls" B10 shows "FALSE", other row results are "#NV" (also
        saw: "#N/A")
   Works fine with "sample.ods"

In attached "370fromscratch.xls" often scrolling down until values invisible and scrolling back heals the problem. 

Always inserting a row anywhere above or below matrix healed the problem for me. 

Already Reproducible
---------------------
3.6.0.0.beta1

Server installation of Master "LOdev 3.6.0alpha0+  – WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 7175cee]" (tinderbox: Win-x86@6-fast, pull time 2012-05-16 22:07:37)


Still worked fine
-----------------
Server installation of  Master "LOdev 3.6.0alpha0+  – WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 475d0c5-829fc92-39746e8-206648e-fefd87]" (2012-02-14)

@Kohei, @Markus:
Please set Status to ASSIGNED and add yourself to "Assigned To" if you accept this Bug
Comment 5 Rainer Bielefeld Retired 2012-07-03 05:51:08 UTC
Created attachment 63765 [details]
Simplyfied Sample

See Comment 4
Comment 6 Eike Rathke 2012-07-03 14:01:10 UTC
During interpret for B10 the ScFormulaResult::GetMatrixFormulaCellToken() in ScFormulaCell::GetMatColsRows() returns a formula::svHybridCell, hence the nCols and nRows are 0 and a 1x0 matrix is created in ScInterpreter::GetNewMat() from ScInterpreter::ScRow()

The following calls to ScInterpreter::ScMatRef() for B11:B30 then of course don't find a valid positional offset in the matrix in B10
Comment 7 Eike Rathke 2012-07-04 10:42:45 UTC
I guess the hybrid result stuff needs to handle matrix properly, wrapping my head around this..
Comment 8 Not Assigned 2012-07-05 11:40:29 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

resolved fdo#51664 some matrix cases broken in binary Excel import
Comment 9 Not Assigned 2012-07-05 11:47:07 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d5bd0ff8450985d0adadfdb13b4d97249b1b4bf4&g=libreoffice-3-6

resolved fdo#51664 some matrix cases broken in binary Excel import


It will be available in LibreOffice 3.6.