diff options
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 20 |
3 files changed, 39 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 809ba8520e33..e7e7f6041c8a 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3811,6 +3811,14 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false if (pActiveViewSh) pActiveViewSh->FindNextUnprot( bShift, true ); + + ScModule* pScMod = SC_MOD(); + const ScInputOptions& rOpt = pScMod->GetInputOptions(); + + if ( (rOpt.GetMoveKeepEdit() && !comphelper::LibreOfficeKit::isActive()) + || (pActiveViewSh->GetMoveKeepEdit() && comphelper::LibreOfficeKit::isActive()) ) + pScMod->SetInputMode( SC_INPUT_TABLE ); + return true; } @@ -3851,6 +3859,12 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false if (pActiveViewSh) pActiveViewSh->MoveCursorEnter( bShift && !bControl ); + ScModule* pScMod = SC_MOD(); + const ScInputOptions& rOpt = pScMod->GetInputOptions(); + if ( (rOpt.GetMoveKeepEdit() && !comphelper::LibreOfficeKit::isActive()) + || (pActiveViewSh->GetMoveKeepEdit() && comphelper::LibreOfficeKit::isActive()) ) + pScMod->SetInputMode( SC_INPUT_TABLE ); + bUsed = true; } break; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index b537af6900d2..fff123aa1bc6 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -174,6 +174,8 @@ private: bool bInPrepareClose; bool bInDispose; + bool bMoveKeepEdit; + sal_uInt16 nCurRefDlgId; std::unique_ptr<SfxBroadcaster> pAccessibilityBroadcaster; @@ -437,6 +439,9 @@ public: void ResetDragObject(); void SetDragLink(const OUString& rDoc, const OUString& rTab, const OUString& rArea); void SetDragJump(ScDocument* pLocalDoc, const OUString& rTarget, const OUString& rText); + + void SetMoveKeepEdit(bool value) { bMoveKeepEdit = value; }; + bool GetMoveKeepEdit() { return bMoveKeepEdit; }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index e6c89b6a2b9c..b7bd2daa4450 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -40,6 +40,7 @@ #include <autoform.hxx> #include <cellsh.hxx> #include <inputhdl.hxx> +#include <inputopt.hxx> #include <editable.hxx> #include <funcdesc.hxx> #include <markdata.hxx> @@ -1087,6 +1088,25 @@ void ScCellShell::Execute( SfxRequest& rReq ) OSL_FAIL("old slot SID_MARKAREA"); break; + case FID_MOVE_KEEP_INSERT_MODE: + { + const SfxBoolItem* pEnabledArg = rReq.GetArg<SfxBoolItem>(FID_MOVE_KEEP_INSERT_MODE); + if (!pEnabledArg) { + SAL_WARN("sfx.appl", "FID_MOVE_KEEP_INSERT_MODE: must specify if you would like this to be enabled"); + break; + } + + ScInputOptions aInputOptions = pScMod->GetInputOptions(); + + aInputOptions.SetMoveKeepEdit(pEnabledArg->GetValue()); + pScMod->SetInputOptions(aInputOptions); + + if (comphelper::LibreOfficeKit::isActive()) + pTabViewShell->SetMoveKeepEdit(pEnabledArg->GetValue()); + + break; + } + default: OSL_FAIL("ScCellShell::Execute: unknown slot"); break; |