diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-28 12:07:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-28 14:43:40 +0200 |
commit | 1a6d250f34c63808552f783a31a315bc7d80ca93 (patch) | |
tree | 8e308b6a4f665c4ab912dbfa518db56ccc433c55 /sc | |
parent | da09513ae6221f46ee453943b3669d1d922a4aa3 (diff) |
Resolves: tdf#155453 formatting lost when formula bar edited via IM
do like we do for simple key strokes and forward to the ScModule
InputHdl
Change-Id: I2d99c23e8ac03b6de2498c6378a0dc5d11530248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152351
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a85baa1ccca4..a3e8f0fd591b 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1709,7 +1709,19 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) // Prevent that the EditView is lost when switching between Views pScMod->SetInEditCommand( true ); - m_xEditView->Command( rCEvt ); + + // tdf#155453 send InputMethod events received by the InputBar through + // ScInputHandler so formatting in other views can be retained + bool bExtInput = nCommand == CommandEventId::StartExtTextInput || + nCommand == CommandEventId::ExtTextInput || + nCommand == CommandEventId::EndExtTextInput; + + ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); + if (bExtInput && pInputHdl) + pInputHdl->InputCommand(rCEvt); + else + m_xEditView->Command( rCEvt ); + pScMod->SetInEditCommand( false ); // CommandEventId::StartDrag does not mean by far that the content was actually changed, @@ -1731,15 +1743,6 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt ) } } } - else if ( nCommand == CommandEventId::EndExtTextInput ) - { - if (bFormulaMode) - { - ScInputHandler* pHdl = SC_MOD()->GetInputHdl(); - if (pHdl) - pHdl->InputCommand(rCEvt); - } - } else if ( nCommand == CommandEventId::CursorPos ) { // don't call InputChanged for CommandEventId::CursorPos |