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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 24 10:11:49 UTC 2018


 oox/source/ppt/timenodelistcontext.cxx     |   16 ++++++++--------
 sd/qa/unit/data/pptx/tdf113818-swivel.pptx |binary
 sd/qa/unit/export-tests.cxx                |   15 +++++++++++++++
 3 files changed, 23 insertions(+), 8 deletions(-)

New commits:
commit 0bc245ede6ec5831561e950299071f57b0329da8
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Sat Jul 14 14:02:14 2018 +0800
Commit:     Mark Hung <marklh9 at gmail.com>
CommitDate: Tue Jul 24 12:11:24 2018 +0200

    tdf#113818 convert formula of AnimContext.
    
    Change-Id: I0f6f08247eaf8099d84c0e8201d22fc507b1cac4
    Reviewed-on: https://gerrit.libreoffice.org/57414
    Tested-by: Jenkins
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 2bd2e2a78f72..b286acdd6d94 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -578,17 +578,17 @@ namespace oox { namespace ppt {
                         Any aTime = GetTimeAnimateValueTime( tav.msTime );
                         aTime >>= aKeyTimes[i];
                         aValues[i] = tav.maValue;
+                        convertAnimationValueWithTimeNode(mpNode, aValues[i]);
 
-                        OUString aTest;
-                        tav.maValue >>= aTest;
-                        if( !aTest.isEmpty() )
+                        // Examine pptx documents and find that only the first tav
+                        // has the formula set. The formula can be used for the whole.
+                        if (!tav.msFormula.isEmpty())
                         {
-                            aValues[i] = tav.maValue;
-                        }
-                        else
-                        {
-                            aProps[ NP_FORMULA ] <<= tav.msFormula;
+                            OUString sFormula = tav.msFormula;
+                            convertMeasure(sFormula);
+                            aProps[NP_FORMULA] <<= sFormula;
                         }
+
                         ++i;
                     }
                     aProps[ NP_VALUES ] <<= aValues;
diff --git a/sd/qa/unit/data/pptx/tdf113818-swivel.pptx b/sd/qa/unit/data/pptx/tdf113818-swivel.pptx
new file mode 100755
index 000000000000..f39225223acd
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf113818-swivel.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 1c494ae33188..71509ca61eea 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -100,6 +100,7 @@ public:
     void testTextRotation();
     void testTdf115394PPT();
     void testBulletsAsImage();
+    void testTdf113818();
     void testTdf113822();
 
     CPPUNIT_TEST_SUITE(SdExportTest);
@@ -126,6 +127,7 @@ public:
     CPPUNIT_TEST(testTextRotation);
     CPPUNIT_TEST(testTdf115394PPT);
     CPPUNIT_TEST(testBulletsAsImage);
+    CPPUNIT_TEST(testTdf113818);
     CPPUNIT_TEST(testTdf113822);
 
     CPPUNIT_TEST_SUITE_END();
@@ -1094,6 +1096,19 @@ void SdExportTest::testTdf113822()
     xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf113818()
+{
+    utl::TempFile tempFile;
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf113818-swivel.pptx"), PPTX);
+
+    xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
+
+    xmlDocPtr pXmlDoc = parseExport(tempFile, "content.xml");
+    assertXPath(pXmlDoc, "//anim:animate[1]", "formula", "width*sin(2.5*pi*$)");
+    assertXPath(pXmlDoc, "//anim:animate[1]", "values", "0;1");
+    xDocShRef->DoClose();
+}
+
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 


More information about the Libreoffice-commits mailing list