[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - cui/source

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


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

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

    coverity#1307697 Dereference null return value
    
    (cherry picked from commit a7e7d057a4a574b337f3df6e9a600aac918be09c)
    
    Change-Id: I48bf70689153b83bd1da7ff1553a4a3ec823d1b2

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index a396f49..2e7e2b4 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -837,14 +837,18 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
                 if ( !bIsLink && !bIsGraphicValid )
                     bIsGraphicValid = LoadLinkedGraphic_Impl();
 
-                if (   bGraphTransparencyChanged ||
-                       eNewPos != eOldPos
-                    || bIsLink != bWasLink
-                    || ( bWasLink  && rOldItem.GetGraphicLink()
-                                       != aBgdGraphicPath )
-                    || ( !bWasLink && rOldItem.GetGraphic()->GetBitmap()
-                                       != aBgdGraphic.GetBitmap() )
-                   )
+                bool bModifyBrush = false;
+                if (bGraphTransparencyChanged || 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