summaryrefslogtreecommitdiff
path: root/svtools/source/contnr/svimpbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/contnr/svimpbox.cxx')
-rw-r--r--svtools/source/contnr/svimpbox.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 69c866324279..0ae2d0caf635 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1311,10 +1311,12 @@ void SvImpLBox::FillView()
{
if( !pStartEntry )
{
- sal_uInt16 nVisibleViewCount = static_cast<sal_uInt16>(pView->GetVisibleCount());
- sal_uInt16 nTempThumb = static_cast<sal_uInt16>(aVerSBar->GetThumbPos());
- if( nTempThumb >= nVisibleViewCount )
- nTempThumb = nVisibleViewCount - 1;
+ sal_uLong nVisibleViewCount = pView->GetVisibleCount();
+ long nTempThumb = aVerSBar->GetThumbPos();
+ if( nTempThumb < 0 )
+ nTempThumb = 0;
+ else if( static_cast<unsigned long>(nTempThumb) >= nVisibleViewCount )
+ nTempThumb = nVisibleViewCount == 0 ? 0 : nVisibleViewCount - 1;
pStartEntry = pView->GetEntryAtVisPos(nTempThumb);
}
if( !pStartEntry )