diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 59329047bf64..a90a0b309137 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -217,6 +217,7 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO void InputGetSelection( sal_Int32& rStart, sal_Int32& rEnd ); void InputSetSelection( sal_Int32 nStart, sal_Int32 nEnd ); void InputReplaceSelection( const OUString& rStr ); + void InputTurnOffWinEngine(); OUString InputGetFormulaStr(); void ActivateInputWindow( const OUString* pStr = NULL, sal_Bool bMatrix = false ); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 9e06c6bf80bf..00bcf3cb48cc 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -3904,6 +3904,20 @@ void ScInputHandler::InputReplaceSelection( const OUString& rStr ) bModified = true; } +void ScInputHandler::InputTurnOffWinEngine() +{ + bInOwnChange = true; // disable ModifyHdl (reset below) + + eMode = SC_INPUT_NONE; + /* TODO: it would be better if there was some way to reset the input bar + * engine instead of deleting and having it recreate through + * GetFuncEditView(), but first least invasively let this fix fdo#71667 and + * fdo#72278 without reintroducing fdo#69971. */ + StopInputWinEngine(true); + + bInOwnChange = false; +} + //======================================================================== // ScInputHdlState //======================================================================== diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 59e8fcfb042d..dfeeba9d30af 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1543,6 +1543,13 @@ void ScModule::InputReplaceSelection( const OUString& rStr ) pHdl->InputReplaceSelection( rStr ); } +void ScModule::InputTurnOffWinEngine() +{ + ScInputHandler* pHdl = GetInputHdl(); + if (pHdl) + pHdl->InputTurnOffWinEngine(); +} + OUString ScModule::InputGetFormulaStr() { ScInputHandler* pHdl = GetInputHdl(); diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index f3b05d55a783..3dccb81fe1ed 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -623,7 +623,7 @@ void ScFormulaDlg::setCurrentFormula(const OUString& _sReplacement) //ScMultiTextWnd::Paint a new editengine will have been created via //GetEditView with its default Modification handler enabled. So ensure //its off when we will access it via InputReplaceSelection - pScMod->InputEnterHandler(); + pScMod->InputTurnOffWinEngine(); } pScMod->InputReplaceSelection(_sReplacement); } diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 03a7da167622..d3fc3b9f151f 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -233,6 +233,7 @@ public: void InputGetSelection ( sal_Int32& rStart, sal_Int32& rEnd ); void InputSetSelection ( sal_Int32 nStart, sal_Int32 nEnd ); void InputReplaceSelection ( const OUString& rStr ); + void InputTurnOffWinEngine(); bool IsFormulaMode() const { return bFormulaMode; } ScInputWindow* GetInputWindow() { return pInputWin; }