summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@gmail.com>2024-02-22 13:54:06 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2024-03-06 11:21:47 +0100
commitc60598390725cc23dc1401beec057f1386226ac8 (patch)
tree073d256e05923fde7597d3f54e1e35feb0ae63ac /sc
parent81dae2ca5187bd24aea0befb099a5b53535b5d03 (diff)
Moving parts of readonly checks from model to view.
Summary for what's done with this commit: init.cxx * Add guards for modify commands. viewsh: * Add "IsCurrentLokViewReadOnly" for ease of use. unocitm: * Add guard for modify comamnds dispatch.cxx * Implement readonlyview. objmisc: * Modify IsReadOnlyUI check for LokReadOnly view. svx.sdi: * Disable TableChangeCurrentBorderPosition command for readOnly views. sw-editwin: * Treat mouse moves as readonly when the view is LokReadOnly. gridwin: * For autofilter. impedit2, inputhdl: * For text input. svdedtc: * For sdr object dragging. Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: I71fc353976256bce22042bbb6042ee464b65cc13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163731 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx6
-rw-r--r--sc/source/ui/view/gridwin.cxx2
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 285e1dab8f6f..a580ec911550 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2517,7 +2517,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
aTester.TestSelectedBlock(
rDoc, aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Col(), aCursorPos.Row(), rMark );
- bool bStartInputMode = true;
+ bool bStartInputMode = !(pActiveViewSh->GetViewShell() && pActiveViewSh->GetViewShell()->IsLokReadOnlyView());
if (!aTester.IsEditable())
{
@@ -3953,7 +3953,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
UpdateActiveView();
bool bNewView = DataChanging( nChar );
- if (bProtected) // Protected cell?
+ if (bProtected || (pActiveViewSh->GetViewShell() && pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // Protected cell?
bUsed = true; // Don't forward KeyEvent
else // Changes allowed
{
@@ -4187,7 +4187,7 @@ void ScInputHandler::InputCommand( const CommandEvent& rCEvt )
UpdateActiveView();
bool bNewView = DataChanging( 0, true );
- if (!bProtected) // changes allowed
+ if (!bProtected && !(pActiveViewSh->GetViewShell() && pActiveViewSh->GetViewShell()->IsLokReadOnlyView())) // changes allowed
{
if (bNewView) // create new edit view
{
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 426e0d88cf58..88d64a526e9e 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1716,7 +1716,7 @@ bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
SfxInPlaceClient* pClient = mrViewData.GetViewShell()->GetIPClient();
bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
- if ( mrViewData.IsActive() && !bOleActive )
+ if ( mrViewData.IsActive() && !bOleActive && !mrViewData.GetViewShell()->IsLokReadOnlyView())
{
ScDocument& rDoc = mrViewData.GetDocument();
SCTAB nTab = mrViewData.GetTabNo();