[Libreoffice-commits] core.git: include/oox oox/source

Matúš Kukan matus.kukan at collabora.com
Tue Sep 9 14:14:18 PDT 2014


 include/oox/drawingml/shape.hxx                            |    1 +
 oox/source/drawingml/table/tablebackgroundstylecontext.cxx |    1 -
 oox/source/drawingml/table/tablecell.cxx                   |    9 ++-------
 3 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit e2723d00b77dc1044e2ba599ba93517af34e1ea5
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Tue Sep 9 22:56:23 2014 +0200

    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

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 5882dad..a3bd884 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 4e4cf3c..a91da19 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 dfca833..817caba 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())


More information about the Libreoffice-commits mailing list