diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-13 10:34:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-13 10:37:33 +0100 |
commit | d23a57a29eaed45e15d9b42a83b3c75a2d3b308f (patch) | |
tree | c04a4da38130310e393737c122dcec68b666d2be /sw/source/uibase/uiview | |
parent | da22fb668d21d20432232034cd54af509ded1bbf (diff) |
coverity#1213307 Dereference before null check
I can see nowhere that m_pHScrollbar or m_pVScrollbar are
set to NULL, deleted yes in the dtor, but nowhere NULLed.
Change-Id: I3012be6de1117757237884deebacc9e0e29dc7a7
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 754de842622d..b0016dfdbd7a 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1244,7 +1244,7 @@ int SwPagePreview::_CreateScrollbar( bool bHori ) Window *pMDI = &GetViewFrame()->GetWindow(); SwScrollbar** ppScrollbar = bHori ? &pHScrollbar : &pVScrollbar; - OSL_ENSURE( !*ppScrollbar, "check beforehand!" ); + assert(!*ppScrollbar); //check beforehand! *ppScrollbar = new SwScrollbar( pMDI, bHori ); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index b18ef33b6033..ed80e0b2d535 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -290,7 +290,7 @@ int SwView::_CreateScrollbar( bool bHori ) Window *pMDI = &GetViewFrame()->GetWindow(); SwScrollbar** ppScrollbar = bHori ? &m_pHScrollbar : &m_pVScrollbar; - OSL_ENSURE( !*ppScrollbar, "check beforehand!" ); + assert(!*ppScrollbar); //check beforehand! *ppScrollbar = new SwScrollbar( pMDI, bHori ); UpdateScrollbars(); @@ -305,9 +305,7 @@ int SwView::_CreateScrollbar( bool bHori ) if(GetWindow()) InvalidateBorder(); - // The scrollbar has to be tested again, as in InvalidateBorder possibly - // the scrollbar has been deleted. - if ( !m_bShowAtResize && (*ppScrollbar)) + if (!m_bShowAtResize) (*ppScrollbar)->ExtendedShow(); return 1; |