diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-01 23:02:38 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-12-01 23:03:32 -0500 |
commit | 3b47c8fda324af275aac9e6d237b6da6c8e5ca00 (patch) | |
tree | 26cd745ca8724609c1f9a38ce7a62eda14fb3c8a /sc/qa | |
parent | We need to tell libxml2 parser to decode entities. (diff) | |
download | core-3b47c8fda324af275aac9e6d237b6da6c8e5ca00.tar.gz core-3b47c8fda324af275aac9e6d237b6da6c8e5ca00.zip |
Add test to make sure sheet names with '&' get imported correctly.
Change-Id: Iea7bb77cdbd5f3ba3b658c373b7d4156b2ca6337
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xlsx/sheet-names.xlsx | bin | 0 -> 9425 bytes | |||
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/sheet-names.xlsx b/sc/qa/unit/data/xlsx/sheet-names.xlsx Binary files differnew file mode 100644 index 000000000000..97e0488f4374 --- /dev/null +++ b/sc/qa/unit/data/xlsx/sheet-names.xlsx diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index db2ea40a736a..fab94ba40af9 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -75,6 +75,7 @@ public: //void testContentXLS_XML(); void testSharedFormulaXLS(); void testSharedFormulaXLSX(); + void testSheetNamesXLSX(); void testLegacyCellAnchoredRotatedShape(); void testEnhancedProtectionXLS(); void testEnhancedProtectionXLSX(); @@ -95,6 +96,7 @@ public: //CPPUNIT_TEST(testContentXLS_XML); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLSX); + CPPUNIT_TEST(testSheetNamesXLSX); CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape); CPPUNIT_TEST(testEnhancedProtectionXLS); CPPUNIT_TEST(testEnhancedProtectionXLSX); @@ -402,6 +404,22 @@ void ScFiltersTest::testSharedFormulaXLSX() xDocSh->DoClose(); } +void ScFiltersTest::testSheetNamesXLSX() +{ + ScDocShellRef xDocSh = loadDoc("sheet-names.", XLSX); + ScDocument& rDoc = xDocSh->GetDocument(); + + std::vector<OUString> aTabNames = rDoc.GetAllTableNames(); + CPPUNIT_ASSERT_MESSAGE("The document should have 5 sheets in total.", aTabNames.size() == 5); + CPPUNIT_ASSERT_EQUAL(OUString("S&P"), aTabNames[0]); + CPPUNIT_ASSERT_EQUAL(OUString("Sam's Club"), aTabNames[1]); + CPPUNIT_ASSERT_EQUAL(OUString("\"The Sheet\""), aTabNames[2]); + CPPUNIT_ASSERT_EQUAL(OUString("A<B"), aTabNames[3]); + CPPUNIT_ASSERT_EQUAL(OUString("C>D"), aTabNames[4]); + + xDocSh->DoClose(); +} + void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) { ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); |