summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-15 14:58:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-15 14:58:11 +0100
commitcbf34897f067e0164f85c626650a8f2dc4f998b0 (patch)
tree4d70cc3fc6ba60da767c816faa84f6440e225633
parent33ecb72fd52050687f74828263526a8e836c3bdf (diff)
coverity#1415091 Dereference before null check
Change-Id: If22c6a9d9b312e52b2956fd84618d3e95fda1c3e
-rw-r--r--sd/source/ui/view/drviews7.cxx23
1 files changed, 11 insertions, 12 deletions
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<SdPage&>(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<SdPage&>(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();