summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-14 12:16:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-14 15:02:42 +0100
commit4920bbf768d893e0e0cbf5651f7ad30d11f817fc (patch)
tree44b00ec8fbf3ca10f68ad23bdcf8984ed5a52274 /sd
parent84ca5c4c619c4c6150dc278aa87c496cfb2e54d8 (diff)
coverity#736803 Dereference before null check
Change-Id: I0bdd28c1f43da999ae2bd35d45c1958061f90c07
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/fuinsert.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index da787904b807..ea9621ac3b57 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -224,13 +224,17 @@ void FuInsertClipboard::DoExecute( SfxRequest& )
if( nFormatId != SotClipboardFormatId::NONE && aDataHelper.GetTransferable().is() )
{
sal_Int8 nAction = DND_ACTION_COPY;
+ DrawViewShell* pDrViewSh = nullptr;
- if( !mpView->InsertData( aDataHelper,
+ if (!mpView->InsertData( aDataHelper,
mpWindow->PixelToLogic( Rectangle( Point(), mpWindow->GetOutputSizePixel() ).Center() ),
- nAction, false, nFormatId ) &&
- ( mpViewShell && dynamic_cast< DrawViewShell *>( mpViewShell ) != nullptr ) )
+ nAction, false, nFormatId ))
+ {
+ pDrViewSh = dynamic_cast<DrawViewShell*>(mpViewShell);
+ }
+
+ if (pDrViewSh)
{
- DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>(mpViewShell);
INetBookmark aINetBookmark( "", "" );
if( ( aDataHelper.HasFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ) &&