diff options
Diffstat (limited to 'sc/qa/unit/subsequent_filters-test.cxx')
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index bc82fb98dc9b..78724f8e8ac6 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -221,6 +221,7 @@ public: void testSharedFormulaXLSB(); void testSharedFormulaXLS(); void testSharedFormulaColumnLabelsODS(); + void testSharedFormulaColumnRowLabelsODS(); void testExternalRefCacheXLSX(); void testExternalRefCacheODS(); void testHybridSharedStringODS(); @@ -333,6 +334,7 @@ public: CPPUNIT_TEST(testSharedFormulaXLSB); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaColumnLabelsODS); + CPPUNIT_TEST(testSharedFormulaColumnRowLabelsODS); CPPUNIT_TEST(testExternalRefCacheXLSX); CPPUNIT_TEST(testExternalRefCacheODS); CPPUNIT_TEST(testHybridSharedStringODS); @@ -3470,6 +3472,45 @@ void ScFiltersTest::testSharedFormulaColumnLabelsODS() xDocSh->DoClose(); } +void ScFiltersTest::testSharedFormulaColumnRowLabelsODS() +{ + ScDocShellRef xDocSh = loadDoc("shared-formula/column-row-labels.", FORMAT_ODS); + + CPPUNIT_ASSERT(xDocSh.Is()); + ScDocument& rDoc = xDocSh->GetDocument(); + rDoc.CalcAll(); + + // Expected output in each of the three ranges. + // + // +---+---+---+ + // | 1 | 4 | 7 | + // +---+---+---+ + // | 2 | 5 | 8 | + // +---+---+---+ + // | 3 | 6 | 9 | + // +---+---+---+ + + auto aCheckFunc = [&](SCCOL nStartCol, SCROW nStartRow) + { + double fExpected = 1.0; + for (SCCOL nCol = 0; nCol <= 2; ++nCol) + { + for (SCROW nRow = 0; nRow <= 2; ++nRow) + { + ScAddress aPos(nStartCol+nCol, nStartRow+nRow, 0); + CPPUNIT_ASSERT_EQUAL(fExpected, rDoc.GetValue(aPos)); + fExpected += 1.0; + } + } + }; + + aCheckFunc(5, 1); // F2:H4 + aCheckFunc(9, 1); // J2:L4 + aCheckFunc(1, 6); // B7:D9 + + xDocSh->DoClose(); +} + void ScFiltersTest::testExternalRefCacheXLSX() { ScDocShellRef xDocSh = loadDoc("external-refs.", FORMAT_XLSX); |