From ffbcf926cf7c661521861cdf4bcc90d5ec4dca9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 13 Oct 2015 21:05:18 +0100 Subject: [PATCH] coverity#735838 Dereference after null check Change-Id: I5a0a9cfdac0444beb049bf9e883ffced25500950 --- sd/source/ui/func/fuprlout.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 16665d1c6f64..ab74fae5d2ac 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -93,10 +93,9 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) /* if we are on a master page, the changes apply for all pages and notes- pages who are using the relevant layout */ bool bOnMaster = false; - if( mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr) + if (DrawViewShell *pShell = dynamic_cast(mpViewShell)) { - EditMode eEditMode = - static_cast(mpViewShell)->GetEditMode(); + EditMode eEditMode = pShell->GetEditMode(); if (eEditMode == EM_MASTERPAGE) bOnMaster = true; }