summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-13 14:01:53 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-13 14:04:20 -0400
commit14e21865443a7318c715c2f9ff655d5b21f716ea (patch)
tree9d20130d8431e273507c748baff5312b11f8ab28
parent054738256c37b007a371249cbbe868ee30d6726d (diff)
fdo#78471: Write test for import of shared formulas from BIFF5.
Change-Id: I77fee109adf1c0decc6eb96cf2292f89fde1aceb
-rw-r--r--sc/qa/unit/data/xls/shared-formula/biff5.xlsbin0 -> 49664 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx18
2 files changed, 18 insertions, 0 deletions
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 000000000000..ce72eb10e126
--- /dev/null
+++ b/sc/qa/unit/data/xls/shared-formula/biff5.xls
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index ef0428d02206..2e5a8f6df0d4 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);