summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-18 16:37:23 +0100
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:23:09 +0200
commitc66af8e7842b0e6dab23c2f8cd2b20147b26c3a9 (patch)
tree912dc858c8017e6e83aa8fff05677a80cba712f2 /cui
parentcb2a27641024b9d86a7999f9035efee2278e8950 (diff)
coverity#1307697 Dereference null return value
(cherry picked from commit a7e7d057a4a574b337f3df6e9a600aac918be09c) Change-Id: I48bf70689153b83bd1da7ff1553a4a3ec823d1b2
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/backgrnd.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index a396f49b048e..2e7e2b4e9baf 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;