[Libreoffice-commits] core.git: sw/source
Adam Co
rattles2013 at gmail.com
Thu Nov 14 06:38:45 PST 2013
sw/source/filter/ww8/docxattributeoutput.cxx | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
New commits:
commit 4b0cb789f8ddd87c92216e3e9520f88d3ad9115d
Author: Adam Co <rattles2013 at gmail.com>
Date: Tue Nov 12 11:22:13 2013 +0200
fdo#65295 : swap gradient text-box colors only in case of axis
This commit changes the behavior of the export process of text-box
gradient color. Currently it exports the colors inverted,
but it should do so only when it is an 'axis' gradient.
Change-Id: I8841982c1dbc57616d6e1640d73bc8aa823ae056
Reviewed-on: https://gerrit.libreoffice.org/6646
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 881d9de..6f22fdc 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5897,21 +5897,29 @@ void DocxAttributeOutput::FormatFillGradient( const XFillGradientItem& rFillGrad
const XGradient& rGradient = rFillGradient.GetGradientValue();
OString sStartColor = msfilter::util::ConvertColor(rGradient.GetStartColor());
- m_pFlyFillAttrList->add(XML_color2, "#" + sStartColor);
OString sEndColor = msfilter::util::ConvertColor(rGradient.GetEndColor());
- m_pFlyAttrList->add(XML_fillcolor, "#" + sEndColor);
+
+ OString sColor1 = sStartColor;
+ OString sColor2 = sEndColor;
switch (rGradient.GetGradientStyle())
{
- case XGRAD_LINEAR: break;
case XGRAD_AXIAL:
m_pFlyFillAttrList->add(XML_focus, "50%");
+ // If it is an 'axial' gradient - swap the colors
+ // (because in the import process they were imported swapped)
+ sColor1 = sEndColor;
+ sColor2 = sStartColor;
break;
+ case XGRAD_LINEAR: break;
case XGRAD_RADIAL: break;
case XGRAD_ELLIPTICAL: break;
case XGRAD_SQUARE: break;
case XGRAD_RECT: break;
}
+
+ m_pFlyAttrList->add(XML_fillcolor , "#" + sColor1);
+ m_pFlyFillAttrList->add(XML_color2, "#" + sColor2);
}
m_oFillStyle.reset();
}
More information about the Libreoffice-commits
mailing list