coverity#735838 Dereference after null check

Change-Id: I5a0a9cfdac0444beb049bf9e883ffced25500950
This commit is contained in:
Caolán McNamara
2015-10-13 21:05:18 +01:00
parent 979651c21a
commit ffbcf926cf

View File

@@ -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<DrawViewShell*>(mpViewShell))
{
EditMode eEditMode =
static_cast<DrawViewShell*>(mpViewShell)->GetEditMode();
EditMode eEditMode = pShell->GetEditMode();
if (eEditMode == EM_MASTERPAGE)
bOnMaster = true;
}