[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-0' - include/sfx2 sfx2/source
Zolnai Tamás
tamas.zolnai at collabora.com
Mon Jan 13 04:19:40 PST 2014
include/sfx2/thumbnailview.hxx | 3 --
sfx2/source/control/thumbnailview.cxx | 35 +---------------------------------
2 files changed, 3 insertions(+), 35 deletions(-)
New commits:
commit 1c83930c80b2096a12b84a848a7261dcfe9e9931
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date: Thu Jan 9 14:34:35 2014 +0100
fdo#71628 Startcenter: remove thumbnail selection when focus is moved away
mnHighItemId is never assaigned with a valid value and there is
no sense to store one selected element's index anyway,
because there can be more.
The bMove parameter of ImplGetItem is never used and doesn' work
so remove it.
Change-Id: I91d6bc3fd13a2b44e6961fea66d02702a8f31c2b
(cherry picked from commit 0314034d8b23d5b69399cfcdf6b2f2add73f9f47)
Reviewed-on: https://gerrit.libreoffice.org/7340
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
(cherry picked from commit a55ec81ad75b280edea8aa30f2a31a14489d2036)
Reviewed-on: https://gerrit.libreoffice.org/7357
Reviewed-by: Eike Rathke <erack at redhat.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index ceaea4e..ccd25dc 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -300,7 +300,7 @@ protected:
SFX2_DLLPRIVATE void ImplInitScrollBar();
SFX2_DLLPRIVATE void ImplDeleteItems();
SFX2_DLLPRIVATE void ImplDraw();
- SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const;
+ SFX2_DLLPRIVATE size_t ImplGetItem( const Point& rPoint ) const;
SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetItem( size_t nPos );
SFX2_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
SFX2_DLLPRIVATE ThumbnailViewItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
@@ -328,7 +328,6 @@ protected:
int mnFineness;
- sal_uInt16 mnHighItemId;
sal_uInt16 mnCols;
sal_uInt16 mnFirstLine;
sal_uInt16 mnSpacing;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 4942150..1fe98f1 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -149,7 +149,6 @@ void ThumbnailView::ImplInit()
mnLines = 0;
mnFineness = 5;
mnFirstLine = 0;
- mnHighItemId = 0;
mnCols = 0;
mnSpacing = 0;
mbScroll = false;
@@ -450,7 +449,7 @@ void ThumbnailView::CalculateItemPositions ()
delete pDelScrBar;
}
-size_t ThumbnailView::ImplGetItem( const Point& rPos, bool bMove ) const
+size_t ThumbnailView::ImplGetItem( const Point& rPos ) const
{
if ( !mbHasVisibleItems )
{
@@ -464,13 +463,6 @@ size_t ThumbnailView::ImplGetItem( const Point& rPos, bool bMove ) const
if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos))
return i;
}
-
- // return the previously selected item if spacing is set and
- // the mouse hasn't left the window yet
- if ( bMove && mnSpacing && mnHighItemId )
- {
- return GetItemPos( mnHighItemId );
- }
}
return THUMBNAILVIEW_ITEM_NOTFOUND;
@@ -926,22 +918,7 @@ void ThumbnailView::GetFocus()
void ThumbnailView::LoseFocus()
{
- if (mnHighItemId)
- {
- size_t nPos = GetItemPos(mnHighItemId);
-
- if (nPos != THUMBNAILVIEW_ITEM_NOTFOUND)
- {
- ThumbnailViewItem *pOld = mItemList[nPos];
-
- pOld->setHighlight(false);
-
- if (!pOld->isSelected())
- DrawItem(pOld);
- }
-
- mnHighItemId = 0;
- }
+ deselectItems();
Control::LoseFocus();
@@ -1049,12 +1026,6 @@ void ThumbnailView::RemoveItem( sal_uInt16 nItemId )
mpStartSelRange = mFilteredItemList.end();
}
- // reset variables
- if ( mnHighItemId == nItemId )
- {
- mnHighItemId = 0;
- }
-
CalculateItemPositions();
if ( IsReallyVisible() && IsUpdateMode() )
@@ -1067,7 +1038,6 @@ void ThumbnailView::Clear()
// reset variables
mnFirstLine = 0;
- mnHighItemId = 0;
CalculateItemPositions();
@@ -1081,7 +1051,6 @@ void ThumbnailView::updateItems (const std::vector<ThumbnailViewItem*> &items)
// reset variables
mnFirstLine = 0;
- mnHighItemId = 0;
mItemList = items;
More information about the Libreoffice-commits
mailing list