summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Toth <toth.szabolcs@nisz.hu>2020-11-06 10:44:17 +0100
committerLászló Németh <nemeth@numbertext.org>2020-11-10 11:08:39 +0100
commit9dd43f97b0d8223b571573d1fe5d899fc38d89ba (patch)
tree781ab543ae3f917a5b2906da2b005681a12bd9f6
parent34a83f1949b7bcd22765e0405a37343d86a40dea (diff)
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@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--filter/source/msfilter/util.cxx4
-rw-r--r--sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsxbin0 -> 15723 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx18
3 files changed, 19 insertions, 3 deletions
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
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf136721_letter_sized_paper.xlsx
Binary files 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();