diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-28 20:03:18 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-29 21:29:25 -0430 |
commit | d4af0655a3fc765b73dd8b36442f8139e0d1ea03 (patch) | |
tree | 8d0619b50cb1b76d9671479f14b54d34ec770c6b /sfx2 | |
parent | e3bb872add7705ff956056c5a86cbdd1fe8e34c8 (diff) |
Add a method to deselect all currently selected items in the view.
Change-Id: I4d05e5b851b028798c75a7767706b5aabb94e4b6
Diffstat (limited to 'sfx2')
-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 ); |