diff options
author | Justin Luth <justin_luth@sil.org> | 2017-10-28 09:14:32 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2017-10-30 06:16:24 +0100 |
commit | 9b8a99a1886997f91535ed613e50b3691c716ea1 (patch) | |
tree | fe22c6a7e3911d3b27b396c3727762b28f21c881 /sw/source | |
parent | d30522e46ca884e9bc74af21711d9537e8118859 (diff) |
tdf#92524 ooxmlexport: recognize COL_AUTO for RES_BACKGROUND
FormatBackground was always returning the actual color
instead of AUTO when the color was COL_AUTO because ConvertColor
is being passed Color.GetRGBColor() instead of just Color.
There are three sections here:
-XML_fillcolor: looks like it accepts values like "green" and
"teal". Unclear from documenation whether auto is allowed.
-XML_srgbClr: only accepts rgb number, not auto
-XML_fill: needs this fix - test document available.
Since the section can't globally handle "auto", I left XML_fillcolor
alone, waiting for a proof bug report.
Change-Id: Idecb6a32fba814a6fb3aeb6cc015d793ba6f8cf9
Reviewed-on: https://gerrit.libreoffice.org/43975
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a9ef70d22119..6cbd0a6cdc18 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8109,7 +8109,8 @@ boost::optional<sal_Int32> lcl_getDmlAlpha(const SvxBrushItem& rBrush) void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) { - OString sColor = msfilter::util::ConvertColor( rBrush.GetColor().GetRGBColor() ); + const Color aColor = rBrush.GetColor(); + OString sColor = msfilter::util::ConvertColor( aColor.GetRGBColor() ); boost::optional<sal_Int32> oAlpha = lcl_getDmlAlpha(rBrush); if (m_rExport.SdrExporter().getTextFrameSyntax()) { @@ -8159,6 +8160,9 @@ void DocxAttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) OString sOriginalFill = OUStringToOString( m_sOriginalBackgroundColor, RTL_TEXTENCODING_UTF8 ); + if ( aColor == COL_AUTO ) + sColor = "auto"; + if( !m_pBackgroundAttrList.is() ) { m_pBackgroundAttrList = FastSerializerHelper::createAttrList(); |