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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jul 19 13:10:44 UTC 2018


 sd/qa/unit/data/odp/tdf118783.odp        |binary
 sd/qa/unit/export-tests-ooxml2.cxx       |   16 ++++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   11 ++++++++++-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 71f7ecae6e0ef45730db4e288108cc4a3994612a
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Sun Jul 15 21:04:43 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Thu Jul 19 15:10:20 2018 +0200

    tdf#118783 sd:fix spin animation in saved pptx file.
    
    The attribute name of the AnimateTransform is "Transform"
    but we expect "r" for "Rotate". We need to fix it so that PowerPoint
    recognize it.
    
    Change-Id: I47590d80d28af0a0ac92ef0892b40643f1de3643
    Reviewed-on: https://gerrit.libreoffice.org/57579
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/sd/qa/unit/data/odp/tdf118783.odp b/sd/qa/unit/data/odp/tdf118783.odp
new file mode 100755
index 000000000000..719db63d1d42
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf118783.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 49f43fe0b8ed..74129e88aecf 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -145,6 +145,7 @@ public:
     void testTdf104792();
     void testTdf90627();
     void testTdf104786();
+    void testTdf118783();
     void testTdf104789();
     void testOpenDocumentAsReadOnly();
     void testTdf118768();
@@ -214,6 +215,7 @@ public:
     CPPUNIT_TEST(testTdf104792);
     CPPUNIT_TEST(testTdf90627);
     CPPUNIT_TEST(testTdf104786);
+    CPPUNIT_TEST(testTdf118783);
     CPPUNIT_TEST(testTdf104789);
     CPPUNIT_TEST(testOpenDocumentAsReadOnly);
     CPPUNIT_TEST(testTdf118768);
@@ -1687,6 +1689,20 @@ void SdOOXMLExportTest2::testTdf104786()
     xDocShRef->DoClose();
 }
 
+void SdOOXMLExportTest2::testTdf118783()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/tdf118783.odp"), ODP);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    // check that transition attribute didn't change from 'out' to 'in'
+    xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
+    OUString sAttributeName = getXPathContent(pXmlDocContent, "//p:animRot/p:cBhvr/p:attrNameLst/p:attrName");
+    CPPUNIT_ASSERT_EQUAL(OUString("r"), sAttributeName);
+    xDocShRef->DoClose();
+}
+
 void SdOOXMLExportTest2::testTdf104789()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf104789.pptx"), PPTX);
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a1348e3e29c0..17d7c4f6835d 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1298,7 +1298,16 @@ void PowerPointExport::WriteAnimationNodeAnimateInside(const FSHelperPtr& pFS, c
                         FSEND);
     WriteAnimationNodeCommonPropsStart(pFS, rXNode, true, bMainSeqChild);
     WriteAnimationTarget(pFS, rXAnimate->getTarget());
-    WriteAnimationAttributeName(pFS, rXAnimate->getAttributeName());
+
+    Reference<XAnimateTransform> xTransform(rXNode, UNO_QUERY);
+
+    // The attribute name of AnimateTransform is "Transform", we have to fix it.
+    OUString sNewAttr;
+    if (xTransform.is() && xTransform->getTransformType() == AnimationTransformType::ROTATE)
+            sNewAttr = "Rotate";
+
+    WriteAnimationAttributeName(pFS, xTransform.is() ? sNewAttr : rXAnimate->getAttributeName());
+
     pFS->endElementNS(XML_p, XML_cBhvr);
     WriteAnimateValues(pFS, rXAnimate);
     if (bWriteTo)


More information about the Libreoffice-commits mailing list