summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-03-15 17:17:21 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-26 08:27:21 +0200
commit18520f933a0d1b015d00985bc3499b9415e69c05 (patch)
tree9433a117d267d31f1bbda51aab9eaa6a5ba733ba /sd/source
parent6694066a0a27c3bcb6aa2b2ec15e815454606b7e (diff)
tdf#104786 Don't export empty 'to'
Change-Id: I16b573fd6455813c6be5c2f5a0f0a820360a239f Reviewed-on: https://gerrit.libreoffice.org/51359 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/51406 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 544cf7f6750715ae25bdb3d0904672f7432f5c2f)
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/filter/eppt/epptooxml.hxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx22
2 files changed, 16 insertions, 8 deletions
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index d2cbbd9a4052..d9289b2bedcf 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -114,7 +114,7 @@ private:
void WriteAnimationNodeEffect( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild );
void WriteAnimationNodeCommand(const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, sal_Int32 nXmlNodeType, bool bMainSeqChild );
void WriteAnimationNodeCommonPropsStart( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::animations::XAnimationNode >& rXNode, bool bSingle, bool bMainSeqChild );
- static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rAny );
+ static void WriteAnimationProperty( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rAny, sal_Int32 nToken = 0 );
void WriteAnimationTarget( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Any& rTarget );
bool WriteComments( sal_uInt32 nPageNum );
void ImplWriteBackground( const ::sax_fastparser::FSHelperPtr& pFS, const css::uno::Reference< css::beans::XPropertySet >& aXBackgroundPropSet );
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 1457faf05592..a32c01c66b81 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -894,7 +894,7 @@ void PowerPointExport::WriteTransition(const FSHelperPtr& pFS)
}
}
-void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny)
+void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any& rAny, sal_Int32 nToken)
{
if (!rAny.hasValue())
return;
@@ -902,6 +902,15 @@ void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any&
sal_uInt32 nRgb;
double fDouble;
+ uno::TypeClass aClass = rAny.getValueType().getTypeClass();
+ bool bWriteToken = nToken &&
+ ( aClass == TypeClass_LONG
+ || aClass == TypeClass_DOUBLE
+ || aClass == TypeClass_STRING );
+
+ if (bWriteToken)
+ pFS->startElementNS(XML_p, XML_to, FSEND);
+
switch (rAny.getValueType().getTypeClass())
{
case TypeClass_LONG:
@@ -924,6 +933,9 @@ void PowerPointExport::WriteAnimationProperty(const FSHelperPtr& pFS, const Any&
default:
break;
}
+
+ if (bWriteToken)
+ pFS->endElementNS(XML_p, nToken);
}
void PowerPointExport::WriteAnimateValues(const FSHelperPtr& pFS, const Reference< XAnimate >& rXAnimate)
@@ -973,18 +985,14 @@ void PowerPointExport::WriteAnimateTo(const FSHelperPtr& pFS, const Any& rValue,
SAL_INFO("sd.eppt", "to attribute name: " << USS(rAttributeName));
- pFS->startElementNS(XML_p, XML_to, FSEND);
-
sal_uInt32 nColor;
if (rValue >>= nColor)
{
// RGB color
- WriteAnimationProperty(pFS, rValue);
+ WriteAnimationProperty(pFS, rValue, XML_to);
}
else
- WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, rAttributeName));
-
- pFS->endElementNS(XML_p, XML_to);
+ WriteAnimationProperty(pFS, AnimationExporter::convertAnimateValue(rValue, rAttributeName), XML_to);
}
void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const OUString& rAttributeName)