summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-04 10:29:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-04 11:11:01 +0000
commitdbf601891b2cc20adc9815771ad68dcc9635fa29 (patch)
treeaf1daef00c186094d457dd9c3a7b6c13db3f7b41
parent55a4c5d62974f0e50ac27b6d4215e8130d7604f3 (diff)
coverity#1266472 Dereference null return value
Change-Id: Ifb7c4da642b254d41bf746725ee9435f6bd1efeb
-rw-r--r--sw/source/uibase/shells/basesh.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index dc418f9964f0..054bb02a079f 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -140,11 +140,14 @@ namespace
return pChildWindow ? static_cast<SvxContourDlg*>(pChildWindow->GetWindow()) : NULL;
}
+
+ SvxIMapDlg* GetIMapDlg(SwView &rView)
+ {
+ SfxChildWindow* pWnd = rView.GetViewFrame()->GetChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
+ return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetWindow()) : NULL;
+ }
}
-#define SWIMAPDLG(rView) ( static_cast<SvxIMapDlg*>( rView.GetViewFrame()->GetChildWindow( \
- SvxIMapDlgChildWindow::GetChildWindowId() )-> \
- GetWindow() ) )
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
@@ -919,7 +922,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
break;
case SID_IMAP_EXEC:
{
- SvxIMapDlg* pDlg = SWIMAPDLG(GetView());
+ SvxIMapDlg* pDlg = GetIMapDlg(GetView());
// Check, if the allocation is useful or allowed at all.
if ( rSh.IsFrmSelected() &&
@@ -1460,7 +1463,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
}
else
{
- SvxIMapDlg *pDlg = SWIMAPDLG(GetView());
+ SvxIMapDlg *pDlg = GetIMapDlg(GetView());
if( pDlg->GetEditingObject() != rSh.GetIMapInventor() )
lcl_UpdateIMapDlg( rSh );
}