From 4bc2212a048cde9fc17728eaad4d8637468c1586 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 24 Dec 2014 04:25:03 +0100 Subject: add test for fdo#86734 Change-Id: I1789f9a4ec2f1dec62ea0958bca03e5e2fcd1fc6 --- sc/qa/unit/data/xlsb/shared_formula.xlsb | Bin 0 -> 7651 bytes sc/qa/unit/subsequent_filters-test.cxx | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 sc/qa/unit/data/xlsb/shared_formula.xlsb (limited to 'sc') diff --git a/sc/qa/unit/data/xlsb/shared_formula.xlsb b/sc/qa/unit/data/xlsb/shared_formula.xlsb new file mode 100644 index 000000000000..b304e0826c39 Binary files /dev/null and b/sc/qa/unit/data/xlsb/shared_formula.xlsb differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index d556335402be..f27a5c29cd98 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -173,6 +173,7 @@ public: void testSharedFormulaHorizontalXLS(); void testSharedFormulaWrappedRefsXLS(); void testSharedFormulaBIFF5(); + void testSharedFormulaXLSB(); void testExternalRefCacheXLSX(); void testExternalRefCacheODS(); void testHybridSharedStringODS(); @@ -255,6 +256,7 @@ public: CPPUNIT_TEST(testSharedFormulaHorizontalXLS); CPPUNIT_TEST(testSharedFormulaWrappedRefsXLS); CPPUNIT_TEST(testSharedFormulaBIFF5); + CPPUNIT_TEST(testSharedFormulaXLSB); CPPUNIT_TEST(testExternalRefCacheXLSX); CPPUNIT_TEST(testExternalRefCacheODS); CPPUNIT_TEST(testHybridSharedStringODS); @@ -2556,6 +2558,27 @@ void ScFiltersTest::testSharedFormulaBIFF5() xDocSh->DoClose(); } +void ScFiltersTest::testSharedFormulaXLSB() +{ + ScDocShellRef xDocSh = loadDoc("shared_formula.", XLSB); + CPPUNIT_ASSERT(xDocSh.Is()); + ScDocument& rDoc = xDocSh->GetDocument(); + rDoc.CalcAll(); + + // E6:E376 should be all formulas, and they should belong to the same group. + const ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(0,0,0)); + CPPUNIT_ASSERT(pFC); + CPPUNIT_ASSERT_EQUAL(static_cast(0), pFC->GetSharedTopRow()); + CPPUNIT_ASSERT_EQUAL(static_cast(30), pFC->GetSharedLength()); + + for(SCROW nRow = 0; nRow < 30; ++nRow) + { + ASSERT_DOUBLES_EQUAL(3.0, rDoc.GetValue(0, nRow, 0)); + } + + xDocSh->DoClose(); +} + void ScFiltersTest::testExternalRefCacheXLSX() { ScDocShellRef xDocSh = loadDoc("external-refs.", XLSX); -- cgit