Kaydet (Commit) d23a57a2 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst da22fb66
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment