summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-08-22 01:22:31 +0800
committerMark Hung <marklh9@gmail.com>2018-08-22 12:42:53 +0200
commitdc96b95f4a2c732f678af002bf53765ba3a0a21e (patch)
tree1544a71008be1526fd38d1fadbea8caf5df82e9a
parent969e2dd3575bd13813318a4f30e5b06060f3dce3 (diff)
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 <marklh9@gmail.com>
-rw-r--r--oox/source/ppt/commontimenodecontext.cxx6
-rwxr-xr-xsd/qa/unit/data/pptx/tdf119118.pptxbin0 -> 31815 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx13
3 files changed, 16 insertions, 3 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf119118.pptx
Binary files 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();