From d9b5127b033e55fd7d634f0d5496d7185682677c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 9 Feb 2014 16:00:06 +0000 Subject: coverity#1169824 Explicit null dereferenced Change-Id: I5fe32e480d8cc372bccae25a0d180210e34075cf --- chart2/source/view/main/DummyXShape.cxx | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'chart2/source') diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 8eb97e37f94b..4ed9622617b5 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -1119,26 +1119,23 @@ bool DummyChart::initWindow() winData.pVisual = (void*)(vi->visual); pWindow.reset(new SystemChildWindow(mpWindow.get(), 0, &winData, sal_False)); pChildSysData = pWindow->GetSystemData(); - - if( !pChildSysData ) - return false; } + if (!pWindow || !pChildSysData) + return false; - if( pWindow ) - { - pWindow->SetMouseTransparent( sal_True ); - pWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - pWindow->EnableEraseBackground( sal_False ); - pWindow->SetControlForeground(); - pWindow->SetControlBackground(); + pWindow->SetMouseTransparent( sal_True ); + pWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP ); + pWindow->EnableEraseBackground( sal_False ); + pWindow->SetControlForeground(); + pWindow->SetControlBackground(); + + GLWin.dpy = reinterpret_cast(pChildSysData->pDisplay); + GLWin.win = pChildSysData->aWindow; + GLWin.vi = vi; + GLWin.GLXExtensions = glXQueryExtensionsString( GLWin.dpy, GLWin.screen ); + OSL_TRACE("available GLX extensions: %s", GLWin.GLXExtensions); - GLWin.dpy = reinterpret_cast(pChildSysData->pDisplay); - GLWin.win = pChildSysData->aWindow; - GLWin.vi = vi; - GLWin.GLXExtensions = glXQueryExtensionsString( GLWin.dpy, GLWin.screen ); - OSL_TRACE("available GLX extensions: %s", GLWin.GLXExtensions); - } return true; } -- cgit