diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-08-29 19:14:56 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-09-12 09:43:28 +0200 |
commit | 576acb6f764308d5bcd07da5be9851b46b42d48b (patch) | |
tree | 1b69b0b6afe88736f042639082aca0c0476f5530 /sc | |
parent | f8d3314f198b70c64a4f45e701fa38151207950f (diff) |
tdf#119562 Fix export of AutoFit property of shapes to XLSX
With this patch the "Resize shape to fit text" property
(TextAutoGrowHeight) will be exported correctly to XLSX format.
Change-Id: I488ceead452aef9096e7766f957de425c8486f85
Reviewed-on: https://gerrit.libreoffice.org/59778
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 7626dc2d81dc5eb647d6f8937cc1d220a8b8ef4b)
Diffstat (limited to 'sc')
-rwxr-xr-x | sc/qa/unit/data/xlsx/testShapeAutofit.xlsx | bin | 0 -> 9349 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 16 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/testShapeAutofit.xlsx b/sc/qa/unit/data/xlsx/testShapeAutofit.xlsx Binary files differnew file mode 100755 index 000000000000..d5742cd1c854 --- /dev/null +++ b/sc/qa/unit/data/xlsx/testShapeAutofit.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 083b9931c971..b872e3bfb570 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -186,6 +186,7 @@ public: void testSheetRunParagraphPropertyXLSX(); void testHiddenShapeXLS(); void testHiddenShapeXLSX(); + void testShapeAutofitXLSX(); void testHyperlinkXLSX(); void testMoveCellAnchoredShapesODS(); void testMatrixMultiplicationXLSX(); @@ -296,6 +297,7 @@ public: CPPUNIT_TEST(testSheetRunParagraphPropertyXLSX); CPPUNIT_TEST(testHiddenShapeXLS); CPPUNIT_TEST(testHiddenShapeXLSX); + CPPUNIT_TEST(testShapeAutofitXLSX); CPPUNIT_TEST(testHyperlinkXLSX); CPPUNIT_TEST(testMoveCellAnchoredShapesODS); CPPUNIT_TEST(testMatrixMultiplicationXLSX); @@ -3547,6 +3549,20 @@ void ScExportTest::testHiddenShapeXLSX() xDocSh->DoClose(); } +void ScExportTest::testShapeAutofitXLSX() +{ + ScDocShellRef xDocSh = loadDoc("testShapeAutofit.", FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + + xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/drawings/drawing1.xml", FORMAT_XLSX); + CPPUNIT_ASSERT(pDoc); + + // TextAutoGrowHeight --> "Fit height to text" / "Resize shape to fit text" --> true + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp/xdr:txBody/a:bodyPr/a:spAutoFit", 1); + // TextAutoGrowHeight --> "Fit height to text" / "Resize shape to fit text" --> false + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:sp/xdr:txBody/a:bodyPr/a:noAutofit", 1); +} + void ScExportTest::testHyperlinkXLSX() { ScDocShellRef xDocSh = loadDoc("hyperlink.", FORMAT_XLSX); |