summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-12-29 06:23:53 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-29 06:26:53 +0100
commit0c24686c3970bac7e9a4e214fccfdfffd742149e (patch)
treed91f862be549835a877ed555280e65212d5da5bb
parent16bfddca6187a426523bbe187db4506a34b5511c (diff)
add test for fdo#80091
Change-Id: I8b62c0980275537adea7a4de44d4fe86995da92f
-rw-r--r--sc/qa/unit/data/xls/shared-formula/relative-refs.xlsbin0 -> 7168 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/xls/shared-formula/relative-refs.xls b/sc/qa/unit/data/xls/shared-formula/relative-refs.xls
new file mode 100644
index 000000000000..88678b46e5bf
--- /dev/null
+++ b/sc/qa/unit/data/xls/shared-formula/relative-refs.xls
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2ba00503f10f..529486dce661 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -174,6 +174,7 @@ public:
void testSharedFormulaWrappedRefsXLS();
void testSharedFormulaBIFF5();
void testSharedFormulaXLSB();
+ void testSharedFormulaXLS();
void testExternalRefCacheXLSX();
void testExternalRefCacheODS();
void testHybridSharedStringODS();
@@ -257,6 +258,7 @@ public:
CPPUNIT_TEST(testSharedFormulaWrappedRefsXLS);
CPPUNIT_TEST(testSharedFormulaBIFF5);
CPPUNIT_TEST(testSharedFormulaXLSB);
+ CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testExternalRefCacheXLSX);
CPPUNIT_TEST(testExternalRefCacheODS);
CPPUNIT_TEST(testHybridSharedStringODS);
@@ -2579,6 +2581,27 @@ void ScFiltersTest::testSharedFormulaXLSB()
xDocSh->DoClose();
}
+void ScFiltersTest::testSharedFormulaXLS()
+{
+ ScDocShellRef xDocSh = loadDoc("shared-formula/relative-refs.", XLS);
+ CPPUNIT_ASSERT(xDocSh.Is());
+ ScDocument& rDoc = xDocSh->GetDocument();
+ rDoc.CalcAll();
+
+ // A1:A30 should be all formulas, and they should belong to the same group.
+ const ScFormulaCell* pFC = rDoc.GetFormulaCell(ScAddress(0,1,0));
+ CPPUNIT_ASSERT(pFC);
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(1), pFC->GetSharedTopRow());
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCROW>(29), pFC->GetSharedLength());
+
+ for(SCROW nRow = 0; nRow < 30; ++nRow)
+ {
+ ASSERT_DOUBLES_EQUAL(double(nRow+1), rDoc.GetValue(0, nRow, 0));
+ }
+
+ xDocSh->DoClose();
+}
+
void ScFiltersTest::testExternalRefCacheXLSX()
{
ScDocShellRef xDocSh = loadDoc("external-refs.", XLSX);