[Libreoffice-commits] core.git: filter/source sc/qa

Szabolcs Toth (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 10 10:09:19 UTC 2020


 filter/source/msfilter/util.cxx                        |    4 ++-
 sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx                  |   18 +++++++++++++++--
 3 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 9dd43f97b0d8223b571573d1fe5d899fc38d89ba
Author:     Szabolcs Toth <toth.szabolcs at nisz.hu>
AuthorDate: Fri Nov 6 10:44:17 2020 +0100
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Tue Nov 10 11:08:39 2020 +0100

    tdf#136721 XLSX: add missing A6 paper format
    
    Unrecognized A6 paper format was converted to the
    default A4/Letter previously, see Paper Format
    in Format->Page...
    
    Co-authored-by: Balázs Regényi
    
    Change-Id: If2ea0c4137177aa8be66cb11d4732b14cbc14455
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105392
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 52421c99f892..778fdce07c3f 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -218,7 +218,9 @@ const ApiPaperSize spPaperSizeTable[] =
     { MM2MM100( 201 ),       MM2MM100( 276 )     },          // 65 - ISO B5 extra paper
     { MM2MM100( 420 ),       MM2MM100( 594 )     },          // 66 - A2 paper
     { MM2MM100( 297 ),       MM2MM100( 420 )     },          // 67 - A3 transverse paper
-    { MM2MM100( 322 ),       MM2MM100( 445 )     }           // 68 - A3 extra transverse paper
+    { MM2MM100( 322 ),       MM2MM100( 445 )     },          // 68 - A3 extra transverse paper
+    { 0, 0 },                                                // 69 - undefined
+    { MM2MM100( 105 ),       MM2MM100( 148 ),    },          // 70 - A6 paper
 };
 
 sal_Int32 PaperSizeConv::getMSPaperSizeIndex( const css::awt::Size& rSize )
diff --git a/sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsx b/sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsx
new file mode 100644
index 000000000000..3027a9c0f142
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index b5e382bc0ecf..f9e6e1f3ebb5 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -272,6 +272,7 @@ public:
     void testTdf76047_externalLink();
     void testTdf129969();
     void testTdf84874();
+    void testTdf136721_paper_size();
 
     CPPUNIT_TEST_SUITE(ScExportTest);
     CPPUNIT_TEST(test);
@@ -442,6 +443,7 @@ public:
     CPPUNIT_TEST(testTdf76047_externalLink);
     CPPUNIT_TEST(testTdf129969);
     CPPUNIT_TEST(testTdf84874);
+    CPPUNIT_TEST(testTdf136721_paper_size);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -5566,7 +5568,7 @@ void ScExportTest::testTdf84874()
 
     const ScValidationData* pData = rDoc.GetValidationEntry(1);
     OUString aTitle, aText;
-    pData->GetInput( aTitle, aText );
+    pData->GetInput(aTitle, aText);
     sal_uInt32 nPromptTitleLen = aTitle.getLength();
     sal_uInt32 nPromptTextLen = aText.getLength();
 
@@ -5574,7 +5576,7 @@ void ScExportTest::testTdf84874()
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(255), nPromptTextLen);
 
     ScValidErrorStyle eErrStyle = SC_VALERR_STOP;
-    pData->GetErrMsg( aTitle, aText, eErrStyle );
+    pData->GetErrMsg(aTitle, aText, eErrStyle);
     sal_uInt32 nErrorTitleLen = aTitle.getLength();
     sal_uInt32 nErrorTextLen = aText.getLength();
 
@@ -5584,6 +5586,18 @@ void ScExportTest::testTdf84874()
     xDocSh->DoClose();
 }
 
+void ScExportTest::testTdf136721_paper_size()
+{
+    ScDocShellRef xShell = loadDoc("tdf136721_letter_sized_paper.", FORMAT_XLSX);
+    CPPUNIT_ASSERT(xShell.is());
+
+    std::shared_ptr<utl::TempFile> pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+    xmlDocUniquePtr pDoc = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
+    CPPUNIT_ASSERT(pDoc);
+
+    assertXPath(pDoc, "/x:worksheet/x:pageSetup", "paperSize", "70");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list