sc/source/ui/app/inputwin.cxx |   23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit ecd270bc44d094cc01e9978af60715c0d3940416
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue May 30 20:25:08 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue May 30 22:27:14 2023 +0200

    Revert "Resolves: tdf#155453 formatting lost when formula bar edited via IM"
    
    This reverts commit 1a6d250f34c63808552f783a31a315bc7d80ca93.
    
    seemed to work at the time, but it crashes now.
    
    Change-Id: I21bdc7a6494de4190d088552ca89ac831b642ba3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152404
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index a3e8f0fd591b..a85baa1ccca4 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1709,19 +1709,7 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt )
 
         // Prevent that the EditView is lost when switching between Views
         pScMod->SetInEditCommand( true );
-
-        // 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 );
-
+        m_xEditView->Command( rCEvt );
         pScMod->SetInEditCommand( false );
 
         //  CommandEventId::StartDrag does not mean by far that the content 
was actually changed,
@@ -1743,6 +1731,15 @@ 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

Reply via email to