Kaydet (Commit) e65da112 authored tarafından Mark Hung's avatar Mark Hung

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: 's avatarMark Hung <marklh9@gmail.com>
üst 629aeda7
...@@ -57,8 +57,8 @@ namespace oox { namespace ppt { ...@@ -57,8 +57,8 @@ namespace oox { namespace ppt {
{ AnimationAttributeEnum::PPT_C, "ppt_c", "DimColor" }, { AnimationAttributeEnum::PPT_C, "ppt_c", "DimColor" },
{ AnimationAttributeEnum::R, "r", "Rotate" }, { AnimationAttributeEnum::R, "r", "Rotate" },
{ AnimationAttributeEnum::XSHEAR, "xshear", "SkewX" }, { AnimationAttributeEnum::XSHEAR, "xshear", "SkewX" },
{ AnimationAttributeEnum::FILLCOLOR, "fillColor", "FillColor" },
{ AnimationAttributeEnum::FILLCOLOR, "fillcolor", "FillColor" }, { AnimationAttributeEnum::FILLCOLOR, "fillcolor", "FillColor" },
{ AnimationAttributeEnum::FILLCOLOR, "fillColor", "FillColor" },
{ AnimationAttributeEnum::FILLTYPE, "fill.type", "FillStyle" }, { AnimationAttributeEnum::FILLTYPE, "fill.type", "FillStyle" },
{ AnimationAttributeEnum::FILLON, "fill.on", "FillOn" }, { AnimationAttributeEnum::FILLON, "fill.on", "FillOn" },
{ AnimationAttributeEnum::STROKECOLOR, "stroke.color", "LineColor" }, { AnimationAttributeEnum::STROKECOLOR, "stroke.color", "LineColor" },
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <oox/export/utils.hxx> #include <oox/export/utils.hxx>
#include <oox/ppt/pptfilterhelpers.hxx>
#include "pptexanimations.hxx" #include "pptexanimations.hxx"
#include "../ppt/pptanimations.hxx" #include "../ppt/pptanimations.hxx"
...@@ -1020,21 +1021,7 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const ...@@ -1020,21 +1021,7 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName)); SAL_INFO("sd.eppt", "write attribute name: " << USS(rAttributeName));
const char* pAttribute = nullptr; if (rAttributeName == "X;Y")
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")
{ {
pFS->startElementNS(XML_p, XML_attrName, FSEND); pFS->startElementNS(XML_p, XML_attrName, FSEND);
pFS->writeEscaped("ppt_x"); pFS->writeEscaped("ppt_x");
...@@ -1044,45 +1031,19 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const ...@@ -1044,45 +1031,19 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
pFS->writeEscaped("ppt_y"); pFS->writeEscaped("ppt_y");
pFS->endElementNS(XML_p, XML_attrName); pFS->endElementNS(XML_p, XML_attrName);
} }
else if (rAttributeName == "Width") else
{
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"; const oox::ppt::ImplAttributeNameConversion *attrConv = oox::ppt::getAttributeConversionList();
} const char* pAttribute = nullptr;
else if (rAttributeName == "CharColor")
while(attrConv->mpAPIName != nullptr)
{ {
pAttribute = "style.color"; if(rAttributeName.equalsAscii(attrConv->mpAPIName))
}
else if (rAttributeName == "Opacity")
{ {
pAttribute = "style.opacity"; pAttribute = attrConv->mpMSName;
break;
} }
else if (rAttributeName == "SkewX") attrConv++;
{
pAttribute = "xshear";
}
else
{
SAL_WARN("sd.eppt", "unhandled animation attribute name: " << rAttributeName);
} }
if (pAttribute) if (pAttribute)
...@@ -1091,6 +1052,11 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const ...@@ -1091,6 +1052,11 @@ void PowerPointExport::WriteAnimationAttributeName(const FSHelperPtr& pFS, const
pFS->writeEscaped(pAttribute); pFS->writeEscaped(pAttribute);
pFS->endElementNS(XML_p, XML_attrName); pFS->endElementNS(XML_p, XML_attrName);
} }
else
{
SAL_WARN("sd.eppt", "unhandled animation attribute name: " << rAttributeName);
}
}
pFS->endElementNS(XML_p, XML_attrNameLst); pFS->endElementNS(XML_p, XML_attrNameLst);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment