summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-24 04:25:03 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-24 04:28:08 +0100
commit4bc2212a048cde9fc17728eaad4d8637468c1586 (patch)
tree8185ce82ae0af30f9d5367cf288e09fa3d49d386
parentcb5509987469531f7a10544a3b793abd534d0c78 (diff)
add test for fdo#86734
Change-Id: I1789f9a4ec2f1dec62ea0958bca03e5e2fcd1fc6
-rw-r--r--sc/qa/unit/data/xlsb/shared_formula.xlsbbin0 -> 7651 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx23
2 files changed, 23 insertions, 0 deletions
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsb/shared_formula.xlsb
Binary files 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<SCROW>(0), pFC->GetSharedTopRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(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);