From cbf34897f067e0164f85c626650a8f2dc4f998b0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 15 Jul 2017 14:58:11 +0100 Subject: coverity#1415091 Dereference before null check Change-Id: If22c6a9d9b312e52b2956fd84618d3e95fda1c3e --- sd/source/ui/view/drviews7.cxx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 3feab2fe0b0e..b95669665172 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1758,21 +1758,20 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) SdPage *pPage = getCurrentPage(); sal_uInt16 nSlotId = rReq.GetSlot(); const SfxItemSet *pArgs = rReq.GetArgs(); - // const size_t nDescId = rSh->GetCurPageDesc(); - // const SdPage& rDesc = rSh->GetPageDesc( nDescId ); - Size maSize = pPage->GetSize(); - PageKind ePageKind = GetPageKind(); - const SfxPoolItem* pPoolItem = nullptr; - Size aNewSize(maSize); - sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1; - bool bScaleAll = true; - Orientation eOrientation = pPage->GetOrientation(); - SdPage* pMasterPage = pPage->IsMasterPage() ? pPage : &static_cast(pPage->TRG_GetMasterPage()); - bool bFullSize = pMasterPage->IsBackgroundFullSize(); - sal_uInt16 nPaperBin = pPage->GetPaperBin(); if ( pPage && pArgs ) { + Size aSize = pPage->GetSize(); + PageKind ePageKind = GetPageKind(); + const SfxPoolItem* pPoolItem = nullptr; + Size aNewSize(aSize); + sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1; + bool bScaleAll = true; + Orientation eOrientation = pPage->GetOrientation(); + SdPage* pMasterPage = pPage->IsMasterPage() ? pPage : &static_cast(pPage->TRG_GetMasterPage()); + bool bFullSize = pMasterPage->IsBackgroundFullSize(); + sal_uInt16 nPaperBin = pPage->GetPaperBin(); + if ( ( nSlotId >= SID_ATTR_PAGE_COLOR ) && ( nSlotId <= SID_ATTR_PAGE_FILLSTYLE ) ) { SdrPageProperties& rPageProperties = pPage->getSdrPageProperties(); -- cgit