tdf#158404 Start Center: remove ability to do multiselections
in Recent Documents and Templates views using Shift+arrow keys as
no actions can be executed for multiple selected files.
Multiselection still works as normal in Manage Templates dialog.
Change-Id: I03b9e54abb7772881139763a0c97f36637d01f85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160003
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 655aa3b..54e8440 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -309,6 +309,7 @@ protected:
bool mbShowTooltips : 1;
bool mbDrawMnemonics : 1;
bool mbSelectOnFocus : 1;
bool mbAllowMultiSelection : 1;
Color maFillColor; ///< Background color of the thumbnail view widget.
Color maTextColor; ///< Text color.
Color maHighlightColor; ///< Color of the highlight (background) of the hovered item.
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 6df5347..f6ea127 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -68,6 +68,7 @@ RecentDocsView::RecentDocsView(std::unique_ptr<weld::ScrolledWindow> xWindow, st
, mpLoadRecentFile(nullptr)
, m_nExecuteHdlId(nullptr)
{
mbAllowMultiSelection = false;
AbsoluteScreenPixelRectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 909545e4..eef46f1 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -25,6 +25,7 @@ TemplateDefaultView::TemplateDefaultView(std::unique_ptr<weld::ScrolledWindow> x
std::unique_ptr<weld::Menu> xMenu)
: TemplateLocalView(std::move(xWindow), std::move(xMenu))
{
mbAllowMultiSelection = false;
AbsoluteScreenPixelRectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
tools::Long nItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
ThumbnailView::setItemDimensions( nItemMaxSize, nItemMaxSize, gnTextHeight, gnItemPadding );
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index abb9f97..1ae4701 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -246,6 +246,7 @@ void ThumbnailView::ImplInit()
mbHasVisibleItems = false;
mbShowTooltips = false;
mbDrawMnemonics = false;
mbAllowMultiSelection = true;
maFilterFunc = ViewFilterAll();
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
@@ -681,7 +682,7 @@ bool ThumbnailView::KeyInput( const KeyEvent& rKEvt )
if ( pNext )
{
if (aKeyCode.IsShift() && bValidRange)
if (aKeyCode.IsShift() && bValidRange && mbAllowMultiSelection)
{
std::pair<size_t,size_t> aRange;
size_t nSelPos = mpStartSelRange - mFilteredItemList.begin();