diff options
author | Serge Krot <Serge.Krot@cib.de> | 2020-04-16 15:42:33 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-05-13 10:56:08 +0200 |
commit | 35a3d706d0d7da928ab4dcaddc007594796c24b6 (patch) | |
tree | 070aafcfffae4543834a76a523b9f08f9b7f9d91 /sc/qa | |
parent | 3d6a45a11dd63824aa1096d90caed4cfbd00136e (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>
(cherry picked from commit 6b75874386b7b1ec44f7acc49cd3556a56108ed8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93539
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/tdf79998.ods | bin | 0 -> 41951 bytes | |||
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 20 |
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 Binary files differnew file mode 100644 index 000000000000..201cca140585 --- /dev/null +++ b/sc/qa/unit/data/ods/tdf79998.ods 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(); |