[Libreoffice-commits] core.git: cui/source

Caolán McNamara caolanm at redhat.com
Thu Jun 18 08:38:30 PDT 2015


 cui/source/tabpages/backgrnd.cxx |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit a7e7d057a4a574b337f3df6e9a600aac918be09c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 18 16:37:23 2015 +0100

    coverity#1307697 Dereference null return value
    
    Change-Id: I48bf70689153b83bd1da7ff1553a4a3ec823d1b2

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 8d731f3..8e21658 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -712,13 +712,18 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
                 if ( !bIsLink && !bIsGraphicValid )
                     bIsGraphicValid = LoadLinkedGraphic_Impl();
 
-                if (  eNewPos != eOldPos
-                    || bIsLink != bWasLink
-                    || ( bWasLink  && rOldItem.GetGraphicLink()
-                                       != aBgdGraphicPath )
-                    || ( !bWasLink && rOldItem.GetGraphic()->GetBitmap()
-                                       != aBgdGraphic.GetBitmap() )
-                   )
+                bool bModifyBrush = false;
+                if (eNewPos != eOldPos || bIsLink != bWasLink)
+                    bModifyBrush = true;
+                else if (bWasLink && rOldItem.GetGraphicLink() != aBgdGraphicPath)
+                    bModifyBrush = true;
+                else if (!bWasLink)
+                {
+                    const Graphic* pGraphic = rOldItem.GetGraphic();
+                    if (pGraphic)
+                        bModifyBrush = pGraphic->GetBitmap() != aBgdGraphic.GetBitmap();
+                }
+                if (bModifyBrush)
                 {
                     bModified = true;
 


More information about the Libreoffice-commits mailing list