diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-08-26 19:04:50 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-08-26 23:00:35 +0200 |
commit | 68efa6f5128abf4cd097ae81a4cfd7fecbcb2a80 (patch) | |
tree | 0b7a3bba7b3dc99ab4441f07a4f085bd5d123087 /xmloff/source/text | |
parent | 25c50a71ffdf7c43f8f3dd10736188271cc75ef0 (diff) |
ODF import: workaround dubious draw:fill="solid" on frame styles
Since the gradient frame backgrounds were added in LO 4.1, we export
this:
fo:background-color="transparent" draw:fill="solid"
Which doesn't make a whole lot of sense as this is really a "none" fill,
and now with the backward compatibility stuff in the style import code
we get the pool default color added when setting the BackTransparent
property, and with the draw:fill="solid" it becomes visible and the
background color is now Sky Blue 1.
So try to detect draw:fill="solid" without draw:fill-color attribute
and contradicting transparent legacy attribute and nerf it. This way
we also export draw:fill="none" again, although still with a bogus
draw:fill-color but that shouldn't cause any harm.
Change-Id: I1c2bea46ba7d9a3f042b875df0ca12c7f6037909
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtimppr.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index 1a0f67ef2414..7e65d799d74b 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -20,6 +20,7 @@ #include <osl/thread.h> #include <com/sun/star/awt/FontFamily.hpp> #include <com/sun/star/awt/FontPitch.hpp> +#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/SizeType.hpp> @@ -410,6 +411,8 @@ void XMLTextImportPropertyMapper::finished( XMLPropertyState* pAllMargin = 0; XMLPropertyState* pMargins[4] = { 0, 0, 0, 0 }; ::std::unique_ptr<XMLPropertyState> pNewMargins[4]; + XMLPropertyState* pFillStyle(nullptr); + XMLPropertyState* pFillColor(nullptr); for( ::std::vector< XMLPropertyState >::iterator aIter = rProperties.begin(); aIter != rProperties.end(); @@ -493,6 +496,8 @@ void XMLTextImportPropertyMapper::finished( bHasAnyWidth = true; break; case CTF_BACKGROUND_TRANSPARENCY: pBackTransparency = property; break; case CTF_BACKGROUND_TRANSPARENT: pBackTransparent = property; break; + case CTF_FILLSTYLE: pFillStyle = property; break; + case CTF_FILLCOLOR: pFillColor = property; break; case CTF_PARAMARGINALL: case CTF_PARAMARGINALL_REL: pAllParaMargin = property; break; @@ -655,6 +660,15 @@ void XMLTextImportPropertyMapper::finished( pFontStyleNameCTL, pFontFamilyCTL, pFontPitchCTL, pFontCharSetCTL, &pNewFontStyleNameCTL, &pNewFontFamilyCTL, &pNewFontPitchCTL, &pNewFontCharSetCTL ); + if (pFillStyle && !pFillColor && pBackTransparent + && drawing::FillStyle_SOLID == pFillStyle->maValue.get<drawing::FillStyle>() + && pBackTransparent->maValue.get<bool>()) + { + // fo:background="transparent", draw:fill="solid" without draw:fill-color + // prevent getSvxBrushItemFromSourceSet from adding bogus default color + pFillStyle->mnIndex = -1; + } + // #i5775# don't overwrite %transparency with binary transparency if( ( pBackTransparency != NULL ) && ( pBackTransparent != NULL ) ) { |