summaryrefslogtreecommitdiff
path: root/sfx2/source/control/thumbnailview.cxx
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-09-06 17:03:26 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-09-06 22:06:09 +0200
commit9a37652b79001bf5208841b9221dee851b9b6d0f (patch)
tree3829a008046c858b4f67f698e6b48acc2198355e /sfx2/source/control/thumbnailview.cxx
parent4697d2bda1b37f9cf8b301f5bf044c2390f56333 (diff)
tdf#156959 - Remove pinned icons from thumbnail view item
Remove pinned icons from thumbnail view item and pushed it down to the recent documents view item. This avoids that the pinned icon will be shown in a simple thumbnail view, e.g., in the thumbnail view of the side pane in base. In addition, fixed an error with the number of elements in the thumbnail view in the start center when items are pinned, i.e., removed a spurious new line. Change-Id: I76026bfa9239f709aa60ff12efabe28cb09f0d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156625 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sfx2/source/control/thumbnailview.cxx')
-rw-r--r--sfx2/source/control/thumbnailview.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b0cc1efefb27..65bc3d878df0 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <memory>
+#include "recentdocsviewitem.hxx"
using namespace basegfx;
using namespace basegfx::utils;
@@ -416,16 +417,19 @@ void ThumbnailView::CalculateItemPositions(bool bScrollBarUsed)
ThumbnailViewItem *const pItem = mFilteredItemList[i];
// tdf#38742 - show pinned items in a separate line
- if (bPinnedItems && !pItem->isPinned())
+ if (auto const pRecentDocsItem = dynamic_cast<RecentDocsViewItem*>(pItem))
{
- bPinnedItems = false;
- // Start a new line only if the entire line is not filled
- if ((nCurCount + 1) % mnCols && nCurCount > nFirstItem)
+ if (bPinnedItems && !pRecentDocsItem->isPinned())
{
- x = nStartX;
- y += mnItemHeight + nVItemSpace;
+ bPinnedItems = false;
+ // Start a new line only if the entire line is not filled
+ if (nCurCount % mnCols && nCurCount > nFirstItem)
+ {
+ x = nStartX;
+ y += mnItemHeight + nVItemSpace;
+ }
+ nCurCount = 0;
}
- nCurCount = 0;
}
if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem))