oox/source/ppt/commontimenodecontext.cxx | 6 +++--- sd/qa/unit/data/pptx/tdf119118.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-)
New commits: commit dc96b95f4a2c732f678af002bf53765ba3a0a21e Author: Mark Hung <mark...@gmail.com> AuthorDate: Wed Aug 22 01:22:31 2018 +0800 Commit: Mark Hung <mark...@gmail.com> CommitDate: Wed Aug 22 12:42:53 2018 +0200 tdf#119118 convert tmAbs value to second. setInterval() of IterateContainer actually need second instead of percentage of the duration, we just need to convert tmAbs in millisecond to second to make iterate interval correct. Change-Id: I1dfc3c64187eb5b7fd8f0b6a91f41dc55466b58b Reviewed-on: https://gerrit.libreoffice.org/59412 Tested-by: Jenkins Reviewed-by: Mark Hung <mark...@gmail.com> diff --git a/oox/source/ppt/commontimenodecontext.cxx b/oox/source/ppt/commontimenodecontext.cxx index 26ea235d898d..cae060f4ca22 100644 --- a/oox/source/ppt/commontimenodecontext.cxx +++ b/oox/source/ppt/commontimenodecontext.cxx @@ -647,14 +647,14 @@ OUString getConvertedSubType( sal_Int16 nPresetClass, sal_Int32 nPresetId, sal_I case PPT_TOKEN( tmAbs ): if( mbIterate ) { - double fTime = rAttribs.getUnsigned( XML_val, 0 ); - // time in ms. property is in % TODO - mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fTime; + double fTime = rAttribs.getUnsigned( XML_val, 0 ) / 1000.0; // convert ms. to second. + mpNode->getNodeProperties()[NP_ITERATEINTERVAL] <<= fTime; } return this; case PPT_TOKEN( tmPct ): if( mbIterate ) { + // TODO: should use duration to get iterate interval in second. double fPercent = static_cast<double>(rAttribs.getUnsigned( XML_val, 0 )) / 100000.0; mpNode->getNodeProperties()[ NP_ITERATEINTERVAL ] <<= fPercent; } diff --git a/sd/qa/unit/data/pptx/tdf119118.pptx b/sd/qa/unit/data/pptx/tdf119118.pptx new file mode 100755 index 000000000000..8eba153282d0 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf119118.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index c1e92df177aa..fdd65130a0b4 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -192,6 +192,7 @@ public: void testTdf118836(); void testTdf116350TextEffects(); void testTdf118825(); + void testTdf119118(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -267,6 +268,7 @@ public: CPPUNIT_TEST(testTdf118836); CPPUNIT_TEST(testTdf116350TextEffects); CPPUNIT_TEST(testTdf118825); + CPPUNIT_TEST(testTdf119118); CPPUNIT_TEST_SUITE_END(); @@ -1967,6 +1969,17 @@ void SdOOXMLExportTest2::testTdf118825() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testTdf119118() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf119118.pptx" ), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pXmlDocContent, "//p:iterate", "type", "lt"); + assertXPath(pXmlDocContent, "//p:tmAbs", "val", "200"); + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits