summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-09 22:56:23 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-09-09 23:08:43 +0200
commite2723d00b77dc1044e2ba599ba93517af34e1ea5 (patch)
tree771b006f4192112e312655c1e030218d15f3e04e
parent2ce8b2c37aaebacdce250d6758d93ce7f9a992f0 (diff)
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
-rw-r--r--include/oox/drawingml/shape.hxx1
-rw-r--r--oox/source/drawingml/table/tablebackgroundstylecontext.cxx1
-rw-r--r--oox/source/drawingml/table/tablecell.cxx9
3 files changed, 3 insertions, 8 deletions
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 5882dadde540..a3bd8849fa89 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -50,6 +50,7 @@ struct ShapeStyleRef
{
Color maPhClr;
sal_Int32 mnThemedIdx;
+ ShapeStyleRef() : mnThemedIdx(0) {}
};
typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
index 4e4cf3cd1091..a91da191476a 100644
--- a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
+++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx
@@ -34,7 +34,6 @@ TableBackgroundStyleContext::TableBackgroundStyleContext( ContextHandler2Helper&
: ContextHandler2( rParent )
, mrTableStyle( rTableStyle )
{
- mrTableStyle.getBackgroundFillStyleRef().mnThemedIdx = 0;
}
TableBackgroundStyleContext::~TableBackgroundStyleContext()
diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx
index dfca83305924..817caba51882 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -362,13 +362,8 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oo
{
if (const Theme* pTheme = rFilterBase.getCurrentTheme())
{
- FillProperties const*const pStyle(
- pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx));
- if (pStyle)
- {
- aBgColor = pStyle->getBestSolidColor();
- nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper());
- }
+ aBgColor = pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)->getBestSolidColor();
+ nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper());
}
}
if (aBgColor.isUsed())