sc/source/ui/view/gridwin.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit e0709e9038586d29a43651f2571795b95bc90f6b
Author:     Gökay Şatır <gokaysa...@collabora.com>
AuthorDate: Thu Dec 12 19:28:47 2024 +0300
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Jan 2 11:33:41 2025 +0100

    cool#10794 Don't open validity dropdown in readOnly mode.
    
    Issue: In readonly mode, validity dropdown is still usable.
    
    Since the action is not performed via an uno command but event handling 
(function name is also: HandleMouseButtonDown), we need to add a guard to event 
handler.
    
    This issue is online only. Desktop view doesn't have the issue.
    
    Signed-off-by: Gökay Şatır <gokaysa...@collabora.com>
    Change-Id: Ic0883d610f484cbc2b777200333e6ae5d14f52d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178378
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 09ecd5d28fc7..39d10599a00a 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2115,6 +2115,10 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
                 if (!bWasMouseCaptured && IsMouseCaptured())
                     ReleaseMouse();
 
+                const bool lokReadOnly = 
comphelper::LibreOfficeKit::isActive() && pViewSh->IsLokReadOnlyView();
+                if (lokReadOnly)
+                    return; // Return as if the action was performed, so the 
flow is not affected.
+
                 LaunchDataSelectMenu( aListValPos.Col(), aListValPos.Row() );
 
                 nMouseStatus = SC_GM_FILTER;    // not set in 
DoAutoFilterMenue for bDataSelect

Reply via email to