sc/qa/unit/data/xls/shared-formula/biff5.xls |binary sc/qa/unit/subsequent_filters-test.cxx | 18 ++++++++++++++++++ sc/source/filter/excel/read.cxx | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-)
New commits: commit 286760359bae7e21a772dd104ab17a1df69a57b0 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Tue May 13 14:02:45 2014 -0400 fdo#78471: Don't forget to record the ID of the last record for BIFF5. Shared formula import code depends on this. Change-Id: Iecb009252c56673df33e0d681de825911154903a diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index 05d2fca..5c6e6f2 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -90,7 +90,7 @@ FltError ImportExcel::Read( void ) sal_Size nProgressBasePos = 0; sal_Size nProgressBaseSize = 0; - while( eAkt != Z_Ende ) + for (; eAkt != Z_Ende; mnLastRecId = nOpcode) { if( eAkt == Z_Biff5E ) { commit 14e21865443a7318c715c2f9ff655d5b21f716ea Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Tue May 13 14:01:53 2014 -0400 fdo#78471: Write test for import of shared formulas from BIFF5. Change-Id: I77fee109adf1c0decc6eb96cf2292f89fde1aceb diff --git a/sc/qa/unit/data/xls/shared-formula/biff5.xls b/sc/qa/unit/data/xls/shared-formula/biff5.xls new file mode 100644 index 0000000..ce72eb1 Binary files /dev/null and b/sc/qa/unit/data/xls/shared-formula/biff5.xls differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index ef0428d..2e5a8f6 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -170,6 +170,7 @@ public: void testSharedFormulaHorizontalXLS(); void testSharedFormulaWrappedRefsXLS(); + void testSharedFormulaBIFF5(); void testExternalRefCacheXLSX(); void testExternalRefCacheODS(); void testHybridSharedStringODS(); @@ -247,6 +248,7 @@ public: CPPUNIT_TEST(testColumnStyleXLSX); CPPUNIT_TEST(testSharedFormulaHorizontalXLS); CPPUNIT_TEST(testSharedFormulaWrappedRefsXLS); + CPPUNIT_TEST(testSharedFormulaBIFF5); CPPUNIT_TEST(testExternalRefCacheXLSX); CPPUNIT_TEST(testExternalRefCacheODS); CPPUNIT_TEST(testHybridSharedStringODS); @@ -2522,6 +2524,22 @@ void ScFiltersTest::testSharedFormulaWrappedRefsXLS() xDocSh->DoClose(); } +void ScFiltersTest::testSharedFormulaBIFF5() +{ + ScDocShellRef xDocSh = loadDoc("shared-formula/biff5.", XLS); + CPPUNIT_ASSERT(xDocSh.Is()); + ScDocument* pDoc = xDocSh->GetDocument(); + pDoc->CalcAll(); + + // E6:E376 should be all formulas, and they should belong to the same group. + const ScFormulaCell* pFC = pDoc->GetFormulaCell(ScAddress(4,5,0)); + CPPUNIT_ASSERT(pFC); + CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(5), pFC->GetSharedTopRow()); + CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(371), pFC->GetSharedLength()); + + xDocSh->DoClose(); +} + void ScFiltersTest::testExternalRefCacheXLSX() { ScDocShellRef xDocSh = loadDoc("external-refs.", XLSX); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits