summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2020-06-28 10:57:09 +0800
committerMark Hung <marklh9@gmail.com>2020-07-04 06:40:55 +0200
commit7dcc18b5ac79d9a3e7564492428a275bf9b386db (patch)
treecfc37048ad3ad3d0fae8cb390360a3f339d8f20d /sd
parent92c2318db92c3f102243ef1f8a9a492796932ff6 (diff)
tdf#119223 export the object name for pptx documents.
Originally the name was always an object type plus an index. That not only ignores the existing object name, but also makes an unnamed object named in the roundtrip. So here the object name is used no matter it is empty or not, to keep unamed object unamed. Change-Id: Ib29a8fbc1fd67fa9a4a4efbfd0b2e9c4fb50de0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96908 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/tdf119223.odpbin0 -> 18335 bytes
-rw-r--r--sd/qa/unit/data/xml/tdf90338_0.xml2
-rw-r--r--sd/qa/unit/data/xml/tdf92001_0.xml2
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx36
4 files changed, 37 insertions, 3 deletions
diff --git a/sd/qa/unit/data/odp/tdf119223.odp b/sd/qa/unit/data/odp/tdf119223.odp
new file mode 100644
index 000000000000..efb4306b9c04
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf119223.odp
Binary files differ
diff --git a/sd/qa/unit/data/xml/tdf90338_0.xml b/sd/qa/unit/data/xml/tdf90338_0.xml
index a357211c6a0a..2f779413596b 100644
--- a/sd/qa/unit/data/xml/tdf90338_0.xml
+++ b/sd/qa/unit/data/xml/tdf90338_0.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="5498" positionY="2715" sizeX="11630" sizeY="8623" type="com.sun.star.drawing.CustomShape" name="CustomShape 1" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="e7e6e6" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="5498" positionY="2715" sizeX="11630" sizeY="8623" type="com.sun.star.drawing.CustomShape" name="Freeform 3" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="e7e6e6" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
diff --git a/sd/qa/unit/data/xml/tdf92001_0.xml b/sd/qa/unit/data/xml/tdf92001_0.xml
index 3bfe7f391c88..40e64cdc1cea 100644
--- a/sd/qa/unit/data/xml/tdf92001_0.xml
+++ b/sd/qa/unit/data/xml/tdf92001_0.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<XShapes>
- <XShape positionX="4826" positionY="4826" sizeX="19557" sizeY="12953" type="com.sun.star.drawing.CustomShape" name="CustomShape 1" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
+ <XShape positionX="4826" positionY="4826" sizeX="19557" sizeY="12953" type="com.sun.star.drawing.CustomShape" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
<FillTransparenceGradient style="LINEAR" startColor="000000" endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
<FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 498443d12236..a46edd8c72f3 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -198,6 +198,7 @@ public:
void testTdf132201EffectOrder();
void testShapeSoftEdgeEffect();
void testShapeShadowBlurEffect();
+ void testTdf119223();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -313,6 +314,7 @@ public:
CPPUNIT_TEST(testTdf132201EffectOrder);
CPPUNIT_TEST(testShapeSoftEdgeEffect);
CPPUNIT_TEST(testShapeShadowBlurEffect);
+ CPPUNIT_TEST(testTdf119223);
CPPUNIT_TEST_SUITE_END();
@@ -1579,7 +1581,7 @@ void SdOOXMLExportTest2::testTdf114845_rotateShape()
xDocShRef->DoClose();
xmlDocUniquePtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
- assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr", "name", "CustomShape 5");
+ assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:nvSpPr/p:cNvPr", "name", "Straight Arrow Connector 9");
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm", "flipV", "1");
double dX = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "x").toDouble();
double dY = getXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:xfrm/a:off", "y").toDouble();
@@ -2927,6 +2929,38 @@ void SdOOXMLExportTest2::testShapeShadowBlurEffect()
CPPUNIT_ASSERT_EQUAL(sal_Int32(388), nRadius); // 11 pt
}
+void SdOOXMLExportTest2::testTdf119223()
+{
+ auto xDocShRef
+ = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf119223.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ xDocShRef->DoClose();
+
+ xmlDocUniquePtr pXmlDocRels = parseExport(tempFile, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeCustomShape']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomePicture']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeFormula']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeLine']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeTextbox']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeTable']");
+
+ assertXPath(pXmlDocRels,
+ "//p:cNvPr[@name='SomeGroup']");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();