summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/thumbnailview.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index f73b364cbe41..39b1ce8f0511 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -529,7 +529,9 @@ void ThumbnailView::KeyInput( const KeyEvent& rKEvt )
{
//If the last elemented selected is the start range position
//search for the first selected item
- if (nLastPos == mpStartSelRange - mFilteredItemList.begin())
+ size_t nSelPos = mpStartSelRange - mFilteredItemList.begin();
+
+ if (nLastPos == nSelPos)
{
while (nLastPos && mFilteredItemList[nLastPos-1]->isSelected())
--nLastPos;