diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-09-30 19:55:25 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-10-14 15:28:01 +0200 |
commit | d514c6b8855a0a473986d3039874bef133d68949 (patch) | |
tree | 2f8a1d37486a2087bcdd3dddc76b04c062a2d780 /oox | |
parent | 7d81a3c2690ee7e6e9ac1df47e7afeb9f98bd8e4 (diff) |
bnc#584721: invisible text because of wrong color (white)
Color::getColor() method uses some caching mechanism which
works wrong when the result depend on one of the input parameters.
So avoid caching in these cases.
(cherry picked from commit cfe658c289de030dc3a8fecd3bac0a0004a18061)
Conflicts:
sd/qa/unit/import-tests.cxx
Change-Id: Ifa9221e21e685715454de86d5cec09ff6c266307
Reviewed-on: https://gerrit.libreoffice.org/11724
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/color.cxx | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 59334492a24b..4d05857492c2 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -452,13 +452,10 @@ void Color::clearTransparence() sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr ) const { - /* Special handling for theme style list placeholder colors (state - COLOR_PH), Color::getColor() may be called with different placeholder - colors in the nPhClr parameter. Therefore, the resolved color will not - be stored in this object, thus the state COLOR_FINAL will not be - reached and the transformation container will not be cleared, but the - original COLOR_PH state will be restored instead. */ - bool bIsPh = false; + const sal_Int32 nTempC1 = mnC1; + const sal_Int32 nTempC2 = mnC2; + const sal_Int32 nTempC3 = mnC3; + const ColorMode eTempMode = meMode; switch( meMode ) { @@ -471,7 +468,7 @@ sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr case COLOR_SCHEME: setResolvedRgb( rGraphicHelper.getSchemeColor( mnC1 ) ); break; case COLOR_PALETTE: setResolvedRgb( rGraphicHelper.getPaletteColor( mnC1 ) ); break; case COLOR_SYSTEM: setResolvedRgb( rGraphicHelper.getSystemColor( mnC1, mnC2 ) ); break; - case COLOR_PH: setResolvedRgb( nPhClr ); bIsPh = true; break; + case COLOR_PH: setResolvedRgb( nPhClr ); break; case COLOR_FINAL: return mnC1; } @@ -607,10 +604,23 @@ sal_Int32 Color::getColor( const GraphicHelper& rGraphicHelper, sal_Int32 nPhClr mnC1 = API_RGB_TRANSPARENT; } - meMode = bIsPh ? COLOR_PH : COLOR_FINAL; + sal_Int32 nRet = mnC1; + // Restore the original values when the color depends on one of the input + // parameters (rGraphicHelper or nPhClr) + if( eTempMode >= COLOR_SCHEME && eTempMode <= COLOR_PH ) + { + mnC1 = nTempC1; + mnC2 = nTempC2; + mnC3 = nTempC3; + meMode = eTempMode; + } + else + { + meMode = COLOR_FINAL; + } if( meMode == COLOR_FINAL ) maTransforms.clear(); - return mnC1; + return nRet; } bool Color::hasTransparency() const |