diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xlsx/check-boolean.xlsx | bin | 0 -> 4659 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/check-boolean.xlsx b/sc/qa/unit/data/xlsx/check-boolean.xlsx Binary files differnew file mode 100644 index 000000000000..a7643d19fbe2 --- /dev/null +++ b/sc/qa/unit/data/xlsx/check-boolean.xlsx diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 13c616d350e2..a793239a27ff 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -18,6 +18,9 @@ #include <sfx2/docfile.hxx> #include <sfx2/sfxmodelfactory.hxx> #include <svl/stritem.hxx> +#include <svl/nfkeytab.hxx> +//#include <zformat.hxx> +#include <svl/zformat.hxx> #include <svx/svdograf.hxx> #include "drwlayer.hxx" @@ -86,6 +89,7 @@ public: virtual void tearDown() SAL_OVERRIDE; //ods, xls, xlsx filter tests + void testBooleanFormatXLSX(); void testBasicCellContentODS(); void testRangeNameXLS(); void testRangeNameLocalXLS(); @@ -186,6 +190,7 @@ public: void testEmbeddedImageXLS(); CPPUNIT_TEST_SUITE(ScFiltersTest); + CPPUNIT_TEST(testBooleanFormatXLSX); CPPUNIT_TEST(testBasicCellContentODS); CPPUNIT_TEST(testRangeNameXLS); CPPUNIT_TEST(testRangeNameLocalXLS); @@ -352,6 +357,27 @@ void ScFiltersTest::testBasicCellContentODS() xDocSh->DoClose(); } +void ScFiltersTest::testBooleanFormatXLSX() +{ + ScDocShellRef xDocSh = loadDoc("check-boolean.", XLSX); + ScDocument& rDoc = xDocSh->GetDocument(); + SvNumberFormatter *pNumFormatter = rDoc.GetFormatTable(); + const OUString aBooleanTypeStr = "\"TRUE\";\"TRUE\";\"FALSE\""; + + CPPUNIT_ASSERT_MESSAGE("Failed to load check-boolean.xlsx", xDocSh.Is()); + sal_uInt32 nNumberFormat; + + for (SCROW i = 0; i <= 1; i++) + { + rDoc.GetNumberFormat(0, i, 0, nNumberFormat); + const SvNumberformat *pSvnumberFormat = pNumFormatter->GetEntry(nNumberFormat); + const OUString &rFormatStr = pSvnumberFormat->GetFormatstring(); + CPPUNIT_ASSERT_MESSAGE("Number format != boolean", rFormatStr == aBooleanTypeStr); + } + + xDocSh->DoClose(); +} + void ScFiltersTest::testRangeNameXLS() { ScDocShellRef xDocSh = loadDoc("named-ranges-global.", XLS); |