summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-07-21 09:22:45 +0800
committerMark Hung <marklh9@gmail.com>2018-07-24 12:10:29 +0200
commite65da112029bf7b6a3b5d94b72bcd5d6ca225195 (patch)
treea4346ba39d8fd8d9a94b84e92a808d8f73ea575a
parent629aeda73b2db4246b837b63fb7bcf267111783c (diff)
tdf#118835 fix missing attribute name conversion.
LineColor and LineStyle are missing from the switch-case. Just reuse the conversion list from oox::ppt::getAttributeConversionList(), also reoder the list so that fillcolor is prior than fillColor. Change-Id: Ia78553ad2fc908923da56bc58baf96dbb7d40863 Reviewed-on: https://gerrit.libreoffice.org/57819 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r--oox/source/ppt/pptfilterhelpers.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx82
2 files changed, 25 insertions, 59 deletions
diff --git a/oox/source/ppt/pptfilterhelpers.cxx b/oox/source/ppt/pptfilterhelpers.cxx
index 3c1ab92fc06d..cc4ebfba1e4c 100644
--- a/oox/source/ppt/pptfilterhelpers.cxx
+++ b/oox/source/ppt/pptfilterhelpers.cxx
@@ -57,8 +57,8 @@ namespace oox { namespace ppt {
{ AnimationAttributeEnum::PPT_C, "ppt_c", "DimColor" },
{ AnimationAttributeEnum::R, "r", "Rotate" },
{ AnimationAttributeEnum::XSHEAR, "xshear", "SkewX" },
- { AnimationAttributeEnum::FILLCOLOR, "fillColor", "FillColor" },
{ AnimationAttributeEnum::FILLCOLOR, "fillcolor", "FillColor" },
+ { AnimationAttributeEnum::FILLCOLOR, "fillColor", "FillColor" },
{ AnimationAttributeEnum::FILLTYPE, "fill.type", "FillStyle" },
{ AnimationAttributeEnum::FILLON, "fill.on", "FillOn" },
{ AnimationAttributeEnum::STROKECOLOR, "stroke.color", "LineColor" },
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 17d7c4f6835d..5811334ddff7 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -78,6 +78,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <oox/export/utils.hxx>
+#include <oox/ppt/pptfilterhelpers.hxx>
#include "pptexanimations.hxx"
#include "../ppt/pptanimations.hxx"
@@ -1020,21 +1021,7 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
- const char* pAttribute = nullptr;
-
- if (rAttributeName == "Visibility")
- {
- pAttribute = "style.visibility";
- }
- else if (rAttributeName == "X")
- {
- pAttribute = "ppt_x";
- }
- else if (rAttributeName == "Y")
- {
- pAttribute = "ppt_y";
- }
- else if (rAttributeName == "X;Y")
+ if (rAttributeName == "X;Y")
{
pFS->startElementNS(XML_p, XML_attrName, FSEND);
pFS->writeEscaped("ppt_x");
@@ -1044,52 +1031,31 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
pFS->writeEscaped("ppt_y");
pFS->endElementNS(XML_p, XML_attrName);
}
- else if (rAttributeName == "Width")
- {
- pAttribute = "ppt_w";
- }
- else if (rAttributeName == "Height")
- {
- pAttribute = "ppt_h";
- }
- else if (rAttributeName == "Rotate")
- {
- pAttribute = "r";
- }
- else if (rAttributeName == "FillStyle")
- {
- pAttribute = "fill.type";
- }
- else if (rAttributeName == "FillOn")
- {
- pAttribute = "fill.on";
- }
- else if (rAttributeName == "FillColor")
- {
- pAttribute = "fillcolor";
- }
- else if (rAttributeName == "CharColor")
- {
- pAttribute = "style.color";
- }
- else if (rAttributeName == "Opacity")
- {
- pAttribute = "style.opacity";
- }
- else if (rAttributeName == "SkewX")
- {
- pAttribute = "xshear";
- }
else
{
- SAL_WARN("sd.eppt", "unhandled animation attribute name: " << rAttributeName);
- }
+ const oox::ppt::ImplAttributeNameConversion *attrConv = oox::ppt::getAttributeConversionList();
+ const char* pAttribute = nullptr;
- if (pAttribute)
- {
- pFS->startElementNS(XML_p, XML_attrName, FSEND);
- pFS->writeEscaped(pAttribute);
- pFS->endElementNS(XML_p, XML_attrName);
+ while(attrConv->mpAPIName != nullptr)
+ {
+ if(rAttributeName.equalsAscii(attrConv->mpAPIName))
+ {
+ pAttribute = attrConv->mpMSName;
+ break;
+ }
+ attrConv++;
+ }
+
+ if (pAttribute)
+ {
+ pFS->startElementNS(XML_p, XML_attrName, FSEND);
+ pFS->writeEscaped(pAttribute);
+ pFS->endElementNS(XML_p, XML_attrName);
+ }
+ else
+ {
+ SAL_WARN("sd.eppt", "unhandled animation attribute name: " << rAttributeName);
+ }
}
pFS->endElementNS(XML_p, XML_attrNameLst);