diff options
author | Gökay Şatır <gokaysatir@collabora.com> | 2024-11-21 15:19:01 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2025-02-04 12:55:42 +0100 |
commit | 6d8d9100b043db4f7e4d828261142c3271b81fd5 (patch) | |
tree | 464368bbbfec2c10f9f90baa4fa7988c0a2e30f3 /sc | |
parent | 87f132a5e81557e423456c12c1bdcde13d1e4c66 (diff) |
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.
Change-Id: I446469a2f1fa25c5cdf6c5958f664a46d6d1a741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181085
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f94f19ac7c48..fcbd50bcea60 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1443,7 +1443,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(); } @@ -1454,7 +1457,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(); } |