sc/source/ui/view/cellsh1.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 74b1ae4b308d6e921a3afa1190b82630e560e81e
Author:     Gökay Şatır <gokaysa...@collabora.com>
AuthorDate: Thu Nov 21 15:19:01 2024 +0300
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Dec 2 11:02:34 2024 +0100

    cool#10533
    
    LOK: Do not set the pasteMode when the view is read only.
    
    There is a chance to paste the copied content in read only view if user 
acts too fast.
    We need to set the pasteMode selectively to ensure that the action is not 
performed.
    
    Signed-off-by: Gökay Şatır <gokaysa...@collabora.com>
    Change-Id: I446469a2f1fa25c5cdf6c5958f664a46d6d1a741
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176920
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index c05a98670742..f0f7a4d713da 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1440,7 +1440,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 weld::WaitObject aWait( GetViewData().GetDialogParent() );
                 pTabViewShell->CopyToClip( nullptr, false, false, true );
                 rReq.Done();
-                GetViewData().SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
+
+                if (!comphelper::LibreOfficeKit::isActive() || 
!pTabViewShell->GetViewShell() || 
!pTabViewShell->GetViewShell()->IsLokReadOnlyView())
+                    GetViewData().SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
+
                 pTabViewShell->ShowCursor();
                 pTabViewShell->UpdateCopySourceOverlay();
             }
@@ -1451,7 +1454,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 weld::WaitObject aWait( GetViewData().GetDialogParent() );
                 pTabViewShell->CutToClip();
                 rReq.Done();
-                GetViewData().SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
+
+                if (!comphelper::LibreOfficeKit::isActive() || 
!pTabViewShell->GetViewShell() || 
!pTabViewShell->GetViewShell()->IsLokReadOnlyView())
+                    GetViewData().SetPasteMode( ScPasteFlags::Mode | 
ScPasteFlags::Border );
+
                 pTabViewShell->ShowCursor();
                 pTabViewShell->UpdateCopySourceOverlay();
             }

Reply via email to