summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2020-04-16 15:42:33 +0200
committerEike Rathke <erack@redhat.com>2020-05-06 23:47:31 +0200
commit6b75874386b7b1ec44f7acc49cd3556a56108ed8 (patch)
treefbc444c8d24fbefdb7e5c0b4cab9023b6cfc63a1 /sc/qa/unit
parent07c871457f095816b266adaa101e1c6c37b635d5 (diff)
tdf#79998 FILESAVE: XLSX export with long sheet names (length > 31 characters)
Change-Id: If18e3b751486144f3477b6e0c2615751f57e5565 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92372 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/ods/tdf79998.odsbin0 -> 41951 bytes
-rw-r--r--sc/qa/unit/filters-test.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf79998.ods b/sc/qa/unit/data/ods/tdf79998.ods
new file mode 100644
index 000000000000..201cca140585
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf79998.ods
Binary files differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index dc097180cbbd..43c3483bb281 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -70,6 +70,7 @@ public:
void testSharedFormulaXLSX();
void testSharedFormulaRefUpdateXLSX();
void testSheetNamesXLSX();
+ void testTdf79998();
void testLegacyCellAnchoredRotatedShape();
void testEnhancedProtectionXLS();
void testEnhancedProtectionXLSX();
@@ -96,6 +97,7 @@ public:
CPPUNIT_TEST(testSharedFormulaXLSX);
CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX);
CPPUNIT_TEST(testSheetNamesXLSX);
+ CPPUNIT_TEST(testTdf79998);
CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
CPPUNIT_TEST(testEnhancedProtectionXLS);
CPPUNIT_TEST(testEnhancedProtectionXLSX);
@@ -468,6 +470,24 @@ void ScFiltersTest::testSheetNamesXLSX()
xDocSh->DoClose();
}
+// FILESAVE: XLSX export with long sheet names (length > 31 characters)
+void ScFiltersTest::testTdf79998()
+{
+ // check: original document has tab name > 31 characters
+ ScDocShellRef xDocSh = loadDoc("tdf79998.", FORMAT_ODS);
+ ScDocument& rDoc1 = xDocSh->GetDocument();
+ const std::vector<OUString> aTabNames1 = rDoc1.GetAllTableNames();
+ CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkarten etc)"), aTabNames1[1]);
+
+ // check: saved XLSX document has truncated tab name
+ xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX);
+ ScDocument& rDoc2 = xDocSh->GetDocument();
+ const std::vector<OUString> aTabNames2 = rDoc2.GetAllTableNames();
+ CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkart"), aTabNames2[1]);
+
+ xDocSh->DoClose();
+}
+
static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, const tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ )
{
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();