include/oox/export/utils.hxx | 2 ++ sd/qa/unit/data/pptx/tdf112086.pptx |binary sd/qa/unit/export-tests-ooxml2.cxx | 24 ++++++++++++++++++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 19 +++++++++++++++++++ 4 files changed, 45 insertions(+)
New commits: commit 6676193b9fadea85c08d3e9783e023ffdfa1e682 Author: Szymon KÅos <szymon.k...@collabora.com> Date: Wed Sep 20 10:15:47 2017 +0200 tdf#112086 PPTX export fltValue, ppt_w, ppt_h Change-Id: Ie77a2f5d9b0179d81c81704d7d760fdceecaa6e1 Reviewed-on: https://gerrit.libreoffice.org/42521 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Szymon KÅos <szymon.k...@collabora.com> diff --git a/include/oox/export/utils.hxx b/include/oox/export/utils.hxx index 371cf6a956bf..6bca2edcbd16 100644 --- a/include/oox/export/utils.hxx +++ b/include/oox/export/utils.hxx @@ -33,10 +33,12 @@ inline OString I32SHEX_(sal_Int32 x) return aStr.getStr(); } inline OString I64S_(sal_Int64 x) { return OString::number(x); } +inline OString DS_(double x) { return OString::number(x); } #define I32S(x) I32S_(x).getStr() #define I32SHEX(x) I32SHEX_(x).getStr() #define I64S(x) I64S_(x).getStr() #define IS(x) OString::number( x ).getStr() +#define DS(x) DS_(x).getStr() /** * @return const char* literal "true" for true value, or literal "false" diff --git a/sd/qa/unit/data/pptx/tdf112086.pptx b/sd/qa/unit/data/pptx/tdf112086.pptx new file mode 100755 index 000000000000..ba125df45402 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf112086.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index cd60f8dc95c2..2a12eb021cc6 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -113,6 +113,7 @@ public: void testTdf112557(); void testTdf112334(); void testTdf112089(); + void testTdf112086(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -153,6 +154,7 @@ public: CPPUNIT_TEST(testTdf112557); CPPUNIT_TEST(testTdf112334); CPPUNIT_TEST(testTdf112089); + CPPUNIT_TEST(testTdf112086); CPPUNIT_TEST_SUITE_END(); @@ -1160,6 +1162,28 @@ void SdOOXMLExportTest2::testTdf112089() CPPUNIT_ASSERT_EQUAL(sID, sTarget); } +void SdOOXMLExportTest2::testTdf112086() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf112086.pptx"), PPTX); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml"); + + OUString sVal = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:tavLst/p:tav/p:val/p:fltVal", "val"); + CPPUNIT_ASSERT_EQUAL(OUString("0"), sVal); + + OUString sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[1]/p:cBhvr/p:attrNameLst/p:attrName"); + CPPUNIT_ASSERT_EQUAL(OUString("ppt_w"), sAttributeName); + + sVal = getXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:tavLst/p:tav/p:val/p:fltVal", "val"); + CPPUNIT_ASSERT_EQUAL(OUString("0"), sVal); + + sAttributeName = getXPathContent(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:anim[2]/p:cBhvr/p:attrNameLst/p:attrName"); + CPPUNIT_ASSERT_EQUAL(OUString("ppt_h"), sAttributeName); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 6f3020358202..0a2a57a4360b 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -831,6 +831,7 @@ void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any& return; sal_uInt32 nRgb; + double fDouble; switch (rAny.getValueType().getTypeClass()) { @@ -840,6 +841,12 @@ void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any& XML_val, I32SHEX(nRgb), FSEND); break; + case TypeClass_DOUBLE: + rAny >>= fDouble; + pFS->singleElementNS(XML_p, XML_fltVal, + XML_val, DS(fDouble), + FSEND); + break; case TypeClass_STRING: pFS->singleElementNS(XML_p, XML_strVal, XML_val, USS(*o3tl::doAccess<OUString>(rAny)), @@ -948,6 +955,18 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const pFS->writeEscaped("ppt_y"); pFS->endElementNS(XML_p, XML_attrName); } + else if (rAttributeName == "Width") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_w"); + pFS->endElementNS(XML_p, XML_attrName); + } + else if (rAttributeName == "Height") + { + pFS->startElementNS(XML_p, XML_attrName, FSEND); + pFS->writeEscaped("ppt_h"); + pFS->endElementNS(XML_p, XML_attrName); + } else if (rAttributeName == "Rotate") { pFS->startElementNS(XML_p, XML_attrName, FSEND);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits