[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - oox/source sd/qa
Balazs Varga (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 17 13:30:32 UTC 2019
oox/source/export/drawingml.cxx | 3 ++-
sd/qa/unit/data/odp/testLegacyShapeAutofit.odp |binary
sd/qa/unit/export-tests-ooxml2.cxx | 18 ++++++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
New commits:
commit 3fe3588d6743c27c3734b1b4993f5155c15abe98
Author: Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Aug 21 16:00:42 2019 +0200
Commit: Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue Sep 17 15:29:47 2019 +0200
tdf#127030 PPTX export: keep fixed size of legacy shapes
Classical/legacy shapes lost their fixed size by exporting them with the
option "Resize shape to fit text".
Regression from commit 86b14cc8bd910651cef422a0f7408adc0fc51a17
(tdf#119617 Fix export of Autofit property of shapes to PPTX)
Change-Id: Iab67db113edc61f4c94a89ec1bb8df0736c26f21
Reviewed-on: https://gerrit.libreoffice.org/77888
Reviewed-by: László Németh <nemeth at numbertext.org>
Tested-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit b50d1a42064c8333926166ec047d3467c83d2fd0)
Reviewed-on: https://gerrit.libreoffice.org/79060
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 95d160ab5e4a..de0c65cbcd8d 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2726,8 +2726,9 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
}
else
{
+ // tdf#127030: Only custom shapes obey the TextAutoGrowHeight option.
bool bTextAutoGrowHeight = false;
- if (GetProperty(rXPropSet, "TextAutoGrowHeight"))
+ if (dynamic_cast<SvxCustomShape*>(rXIface.get()) && GetProperty(rXPropSet, "TextAutoGrowHeight"))
mAny >>= bTextAutoGrowHeight;
mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit));
}
diff --git a/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp b/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp
new file mode 100755
index 000000000000..16a900b636c8
Binary files /dev/null and b/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 5a6fbbd5f7f6..6d29d075c62d 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -175,6 +175,7 @@ public:
void testTdf111786();
void testFontScale();
void testShapeAutofitPPTX();
+ void testLegacyShapeAutofitPPTX();
void testTdf115394();
void testTdf115394Zero();
void testTdf115005();
@@ -267,6 +268,7 @@ public:
CPPUNIT_TEST(testTdf111786);
CPPUNIT_TEST(testFontScale);
CPPUNIT_TEST(testShapeAutofitPPTX);
+ CPPUNIT_TEST(testLegacyShapeAutofitPPTX);
CPPUNIT_TEST(testTdf115394);
CPPUNIT_TEST(testTdf115394Zero);
CPPUNIT_TEST(testTdf115005);
@@ -1644,6 +1646,22 @@ void SdOOXMLExportTest2::testShapeAutofitPPTX()
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr/a:noAutofit", 1);
}
+void SdOOXMLExportTest2::testLegacyShapeAutofitPPTX()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/testLegacyShapeAutofit.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+ CPPUNIT_ASSERT(pXmlDocContent);
+
+ // Text in a legacy rectangle
+ assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:txBody/a:bodyPr/a:noAutofit", 1);
+ // Text in (closed) Polygon
+ assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[2]/p:txBody/a:bodyPr/a:noAutofit", 1);
+ // Text in a legacy ellipse
+ assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:txBody/a:bodyPr/a:noAutofit", 1);
+}
+
void SdOOXMLExportTest2::testTdf115394()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115394.pptx"), PPTX);
More information about the Libreoffice-commits
mailing list