summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-01-25 11:57:01 +0100
committerDavid Tardon <dtardon@redhat.com>2013-02-04 08:09:57 +0100
commitadec665d2ca5265f8cad5fcd0063678909b160c9 (patch)
tree993b2ab1fcf7a22a9a5e24cd166afa543cef056d
parent35a45a4508ca4156ebaa4f17df776a971084160d (diff)
rhbz#903615 avoid null ptr dereference
Change-Id: I336e3fffaaa42605b5fab2821c85c473635fbf27
-rw-r--r--svtools/source/contnr/svimpbox.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 6e602076edf8..5d4dd0276f79 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -348,6 +348,9 @@ IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
void SvImpLBox::CursorDown()
{
+ if (!pStartEntry)
+ return;
+
SvTreeListEntry* pNextFirstToDraw = pView->NextVisible(pStartEntry);
if( pNextFirstToDraw )
{
@@ -366,6 +369,9 @@ void SvImpLBox::CursorDown()
void SvImpLBox::CursorUp()
{
+ if (!pStartEntry)
+ return;
+
SvTreeListEntry* pPrevFirstToDraw = pView->PrevVisible(pStartEntry);
if( pPrevFirstToDraw )
{
@@ -391,6 +397,9 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta )
if( !nDelta )
return;
+ if (!pStartEntry)
+ return;
+
SvTreeListEntry* pNext = pView->NextVisible(pStartEntry, nRealDelta);
if( (sal_uLong)pNext == (sal_uLong)pStartEntry )
return;
@@ -428,6 +437,9 @@ void SvImpLBox::PageUp( sal_uInt16 nDelta )
if( !nDelta )
return;
+ if (!pStartEntry)
+ return;
+
SvTreeListEntry* pPrev = pView->PrevVisible(pStartEntry, nRealDelta);
if( (sal_uLong)pPrev == (sal_uLong)pStartEntry )
return;