diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-15 15:20:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-15 16:05:53 +0200 |
commit | d3f7925ccc962eb9adc31fb2174fa18de4b31c0a (patch) | |
tree | 47dc789e47e054204e648f1d57d83951bed29f9d /sw | |
parent | 73318c3db8031127574a3371bf737eb926006d7b (diff) |
initial RTF export of Writer textframe gradients
Change-Id: Ida9774a41964dbeb8840e79425811993a28588af
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 29 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.hxx | 5 |
2 files changed, 32 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index f645c873296b..627767684efa 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -72,6 +72,7 @@ #include <filter/msfilter/rtfutil.hxx> #include <svtools/miscopt.hxx> #include <sfx2/sfxbasemodel.hxx> +#include <svx/xflgrit.hxx> #include <docufld.hxx> #include <fmtclds.hxx> @@ -2963,12 +2964,36 @@ void RtfAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) } } -void RtfAttributeOutput::FormatFillStyle( const XFillStyleItem& /*rFillStyle*/ ) +void RtfAttributeOutput::FormatFillStyle( const XFillStyleItem& rFillStyle ) { + m_oFillStyle.reset(rFillStyle.GetValue()); } -void RtfAttributeOutput::FormatFillGradient( const XFillGradientItem& /*rFillGradient*/ ) +void RtfAttributeOutput::FormatFillGradient( const XFillGradientItem& rFillGradient ) { + if (*m_oFillStyle == XFILL_GRADIENT) + { + m_aFlyProperties.push_back(std::make_pair<OString, OString>("fillType", OString::number(7))); // Shade using the fillAngle + + const XGradient& rGradient = rFillGradient.GetGradientValue(); + const Color& rStartColor = rGradient.GetStartColor(); + m_aFlyProperties.push_back(std::make_pair<OString, OString>("fillBackColor", OString::number(msfilter::util::BGRToRGB(rStartColor.GetColor())))); + + const Color& rEndColor = rGradient.GetEndColor(); + m_aFlyProperties.push_back(std::make_pair<OString, OString>("fillColor", OString::number(msfilter::util::BGRToRGB(rEndColor.GetColor())))); + + switch (rGradient.GetGradientStyle()) + { + case XGRAD_LINEAR: break; + case XGRAD_AXIAL: + m_aFlyProperties.push_back(std::make_pair<OString, OString>("fillFocus", OString::number(50))); + break; + case XGRAD_RADIAL: break; + case XGRAD_ELLIPTICAL: break; + case XGRAD_SQUARE: break; + case XGRAD_RECT: break; + } + } } void RtfAttributeOutput::FormatBox( const SvxBoxItem& rBox ) diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx index 9035b554fc4a..b13be123af36 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.hxx +++ b/sw/source/filter/ww8/rtfattributeoutput.hxx @@ -25,6 +25,9 @@ #include "rtfstringbuffer.hxx" #include <rtl/strbuf.hxx> +#include <svx/xenum.hxx> + +#include <boost/optional.hpp> class SwGrfNode; class SwOLENode; @@ -557,6 +560,8 @@ private: std::vector< std::pair<OString, OString> > m_aFlyProperties; + boost::optional<XFillStyle> m_oFillStyle; + public: RtfAttributeOutput( RtfExport &rExport ); |