Kaydet (Commit) e2723d00 authored tarafından Matúš Kukan's avatar Matúš Kukan

Better place to initialize mnThemedIdx

To make 'if (rBackgroundFillStyle.mnThemedIdx != 0)' actually work
as intended. Avoids invalid call to pTheme->getFillStyle() which
is not supposed to return 0 here.

Change-Id: I323e2628cba64167240e8f0b945e6693b47b8e77
üst 2ce8b2c3
...@@ -50,6 +50,7 @@ struct ShapeStyleRef ...@@ -50,6 +50,7 @@ struct ShapeStyleRef
{ {
Color maPhClr; Color maPhClr;
sal_Int32 mnThemedIdx; sal_Int32 mnThemedIdx;
ShapeStyleRef() : mnThemedIdx(0) {}
}; };
typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap; typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
......
...@@ -34,7 +34,6 @@ TableBackgroundStyleContext::TableBackgroundStyleContext( ContextHandler2Helper& ...@@ -34,7 +34,6 @@ TableBackgroundStyleContext::TableBackgroundStyleContext( ContextHandler2Helper&
: ContextHandler2( rParent ) : ContextHandler2( rParent )
, mrTableStyle( rTableStyle ) , mrTableStyle( rTableStyle )
{ {
mrTableStyle.getBackgroundFillStyleRef().mnThemedIdx = 0;
} }
TableBackgroundStyleContext::~TableBackgroundStyleContext() TableBackgroundStyleContext::~TableBackgroundStyleContext()
......
...@@ -362,13 +362,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo ...@@ -362,13 +362,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
{ {
if (const Theme* pTheme = rFilterBase.getCurrentTheme()) if (const Theme* pTheme = rFilterBase.getCurrentTheme())
{ {
FillProperties const*const pStyle( aBgColor = pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)->getBestSolidColor();
pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)); nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper());
if (pStyle)
{
aBgColor = pStyle->getBestSolidColor();
nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper());
}
} }
} }
if (aBgColor.isUsed()) if (aBgColor.isUsed())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment