Add test to make sure sheet names with '&' get imported correctly.
Change-Id: Iea7bb77cdbd5f3ba3b658c373b7d4156b2ca6337
This commit is contained in:
BIN
sc/qa/unit/data/xlsx/sheet-names.xlsx
Normal file
BIN
sc/qa/unit/data/xlsx/sheet-names.xlsx
Normal file
Binary file not shown.
@@ -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();
|
||||
|
Reference in New Issue
Block a user