From f44aa84331cfa22db6e85e238b6cee698a8d9978 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 18 Sep 2017 15:30:59 +0200 Subject: tdf#112333 PPTX export fill.type & fill.on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2407d0227e10204354ee69fd9a2af9ca93077221 Reviewed-on: https://gerrit.libreoffice.org/42432 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- oox/source/ppt/animvariantcontext.cxx | 31 +++++++++++++++++++++++++++++-- oox/source/ppt/pptfilterhelpers.cxx | 1 + oox/source/ppt/timenodelistcontext.cxx | 13 ++++++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) (limited to 'oox') diff --git a/oox/source/ppt/animvariantcontext.cxx b/oox/source/ppt/animvariantcontext.cxx index bf96b277159f..84703367761f 100644 --- a/oox/source/ppt/animvariantcontext.cxx +++ b/oox/source/ppt/animvariantcontext.cxx @@ -23,6 +23,7 @@ #include "cppuhelper/exc_hlp.hxx" #include +#include #include #include "oox/helper/attributelist.hxx" @@ -139,6 +140,22 @@ namespace oox { namespace ppt { return bRet; } + bool convertFillStyle( const OUString& rString, css::drawing::FillStyle& rValue ) + { + if( rString == "solid" ) + { + rValue = css::drawing::FillStyle::FillStyle_SOLID; + return true; + } + else if( rString == "none" ) + { + rValue = css::drawing::FillStyle::FillStyle_NONE; + return true; + } + else + return false; + } + AnimVariantContext::AnimVariantContext( FragmentHandler2 const & rParent, sal_Int32 aElement, Any & aValue ) : FragmentHandler2( rParent ) , mnElement( aElement ) @@ -186,8 +203,18 @@ namespace oox { namespace ppt { case PPT_TOKEN( strVal ): { OUString val = rAttribs.getString( XML_val, OUString() ); - convertMeasure( val ); // ignore success or failure if it fails, use as is - maValue <<= val; + if( convertMeasure( val ) ) + { + maValue <<= val; + } + else + { + css::drawing::FillStyle eFillStyle; + if( convertFillStyle( val, eFillStyle ) ) + maValue <<= eFillStyle; + else + maValue <<= val; + } return this; } default: diff --git a/oox/source/ppt/pptfilterhelpers.cxx b/oox/source/ppt/pptfilterhelpers.cxx index 6496e9153e60..f117e2a1210d 100644 --- a/oox/source/ppt/pptfilterhelpers.cxx +++ b/oox/source/ppt/pptfilterhelpers.cxx @@ -38,6 +38,7 @@ namespace oox { namespace ppt { { MS_FILLCOLOR, "fillColor", "FillColor" }, { MS_FILLCOLOR, "fillcolor", "FillColor" }, { MS_FILLTYPE, "fill.type", "FillStyle" }, + { MS_FILLTYPE, "fill.on", "FillOn" }, { MS_STROKECOLOR, "stroke.color", "LineColor" }, { MS_STROKEON, "stroke.on", "LineStyle" }, { MS_STYLECOLOR, "style.color", "CharColor" }, diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx index 47e56fe38ebf..8df88793822a 100644 --- a/oox/source/ppt/timenodelistcontext.cxx +++ b/oox/source/ppt/timenodelistcontext.cxx @@ -180,9 +180,16 @@ namespace oox { namespace ppt { OUString aString; if( maTo >>= aString ) { - maTo <<= aString == "visible"; - if( !maTo.has() ) - SAL_WARN("oox.ppt", "conversion failed" ); + if( aString == "visible" || aString == "true" ) + maTo <<= true; + else if( aString == "false" ) + maTo <<= false; + + if (!maTo.has()) + { + SAL_WARN("oox.ppt", "conversion failed"); + maTo <<= false; + } } mpNode->setTo( maTo ); } -- cgit