diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-25 10:28:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-25 12:33:20 +0000 |
commit | a79afdaa11a1af26c9404441dcf27ef197e972b2 (patch) | |
tree | c891a97079d827a780dfeeb775dda265974a5ed5 /toolkit | |
parent | fcdae12f366cef3d204ee34ec7618f0c2e1d57ff (diff) |
coverity#736158 Dereference null return value
Change-Id: Ia3afc3989d1c9a5d9c70b167186fd81a263550fb
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 9b5ff6b2484e..b472c89a0401 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2243,13 +2243,15 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno: if ( isDesignMode() || mpImpl->isEnableVisible() ) { + OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics ); + if (!pDev) + pDev = pWindow->GetParent(); TabPage* pTabPage = dynamic_cast< TabPage* >( pWindow ); if ( pTabPage ) { Point aPos( nX, nY ); Size aSize = pWindow->GetSizePixel(); - OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics ); aPos = pDev->PixelToLogic( aPos ); aSize = pDev->PixelToLogic( aSize ); @@ -2257,12 +2259,8 @@ void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno: return; } - OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics ); Point aPos( nX, nY ); - if ( !pDev ) - pDev = pWindow->GetParent(); - if ( pWindow->GetParent() && !pWindow->IsSystemWindow() && ( pWindow->GetParent() == pDev ) ) { // #i40647# don't draw here if this is a recursive call |