diff options
Diffstat (limited to 'sc/qa/unit/subsequent_filters-test.cxx')
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 28db571e66de..ce65fc6684cf 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -106,6 +106,7 @@ public: virtual void tearDown() override; //ods, xls, xlsx filter tests + void testCondFormatBeginsAndEndsWithXLSX(); void testExtCondFormatXLSX(); void testUpdateCircleInMergedCellODS(); void testDeleteCircleInMergedCellODS(); @@ -297,6 +298,7 @@ public: void testDeleteCirclesInRowAndCol(); CPPUNIT_TEST_SUITE(ScFiltersTest); + CPPUNIT_TEST(testCondFormatBeginsAndEndsWithXLSX); CPPUNIT_TEST(testExtCondFormatXLSX); CPPUNIT_TEST(testUpdateCircleInMergedCellODS); CPPUNIT_TEST(testDeleteCircleInMergedCellODS); @@ -532,6 +534,42 @@ void testRangeNameImpl(const ScDocument& rDoc) } +void ScFiltersTest::testCondFormatBeginsAndEndsWithXLSX() +{ + ScDocShellRef xDocSh = loadDoc("tdf120749.", FORMAT_XLSX); + CPPUNIT_ASSERT_MESSAGE("Failed to load tdf120749.xlsx", xDocSh.is()); + + ScDocument& rDoc = xDocSh->GetDocument(); + + // begins with and ends with conditions + ScConditionalFormat* pFormatA1 = rDoc.GetCondFormat(0, 0, 0); + CPPUNIT_ASSERT(pFormatA1); + ScConditionalFormat* pFormatA2 = rDoc.GetCondFormat(0, 1, 0); + CPPUNIT_ASSERT(pFormatA2); + ScConditionalFormat* pFormatA3 = rDoc.GetCondFormat(0, 2, 0); + CPPUNIT_ASSERT(pFormatA3); + ScConditionalFormat* pFormatA4 = rDoc.GetCondFormat(0, 3, 0); + CPPUNIT_ASSERT(pFormatA4); + + ScRefCellValue aCellA1(rDoc, ScAddress(0, 0, 0)); + OUString aCellStyleA1 = pFormatA1->GetCellStyle(aCellA1, ScAddress(0, 0, 0)); + CPPUNIT_ASSERT(!aCellStyleA1.isEmpty()); + + ScRefCellValue aCellA2(rDoc, ScAddress(0, 1, 0)); + OUString aCellStyleA2 = pFormatA2->GetCellStyle(aCellA2, ScAddress(0, 1, 0)); + CPPUNIT_ASSERT(!aCellStyleA2.isEmpty()); + + ScRefCellValue aCellA3(rDoc, ScAddress(0, 2, 0)); + OUString aCellStyleA3 = pFormatA3->GetCellStyle(aCellA3, ScAddress(0, 2, 0)); + CPPUNIT_ASSERT(!aCellStyleA3.isEmpty()); + + ScRefCellValue aCellA4(rDoc, ScAddress(0, 3, 0)); + OUString aCellStyleA4 = pFormatA4->GetCellStyle(aCellA4, ScAddress(0, 3, 0)); + CPPUNIT_ASSERT(!aCellStyleA4.isEmpty()); + + xDocSh->DoClose(); +} + void ScFiltersTest::testExtCondFormatXLSX() { ScDocShellRef xDocSh = loadDoc("tdf122102.", FORMAT_XLSX); |