diff options
-rw-r--r-- | sfx2/inc/sfx2/thumbnailview.hxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index da69b2b815a3..24827ee6efaa 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -221,6 +221,14 @@ public: bool IsItemSelected( sal_uInt16 nItemId ) const { return nItemId == mnSelItemId; } + /** + * + * @brief unselect all current selected items. + * + **/ + + void unselectItems (); + rtl::OUString GetItemText( sal_uInt16 nItemId ) const; void SetColor( const Color& rColor ); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 886ec9bb1769..f6042b53ac66 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -1042,6 +1042,22 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId ) } } +void ThumbnailView::unselectItems() +{ + for (size_t i = 0, n = mItemList.size(); i < n; ++i) + { + if (mItemList[i]->isSelected()) + { + mItemList[i]->setSelection(false); + + maItemStateHdl.Call(mItemList[i]); + } + } + + if (IsReallyVisible() && IsUpdateMode()) + Invalidate(); +} + rtl::OUString ThumbnailView::GetItemText( sal_uInt16 nItemId ) const { size_t nPos = GetItemPos( nItemId ); |