[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Thu Aug 24 14:39:55 UTC 2017


 sc/source/ui/app/inputhdl.cxx |    8 ++++++++
 sc/source/ui/app/inputwin.cxx |    6 ++++++
 sc/source/ui/inc/inputhdl.hxx |    1 +
 3 files changed, 15 insertions(+)

New commits:
commit d31a8263d564ebd7886f6debdf36cedd031915ea
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Aug 24 16:34:55 2017 +0200

    Resolves: tdf#108795 merge table EditEngine language attributes to input line
    
    ... when editing there, so the SvxAutoCorrect behaviour is synchronized.
    Depends on commit 06d14411a447cd798d1f0678a3c5e06f5278a1cb that disentangles
    the stateful SvxAutoCorrect instance.
    
    Change-Id: Ic6aac1f2acc36b500144be50a20a4784a3ba62dc
    Reviewed-on: https://gerrit.libreoffice.org/41521
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9be7701dfb92..f9435aac55f1 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2185,6 +2185,14 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn
     return bNewTable;
 }
 
+void ScInputHandler::MergeLanguageAttributes( ScEditEngineDefaulter& rDestEngine ) const
+{
+    const SfxItemSet& rSrcSet = mpEditEngine->GetDefaults();
+    rDestEngine.SetDefaultItem( rSrcSet.Get( EE_CHAR_LANGUAGE ));
+    rDestEngine.SetDefaultItem( rSrcSet.Get( EE_CHAR_LANGUAGE_CJK ));
+    rDestEngine.SetDefaultItem( rSrcSet.Get( EE_CHAR_LANGUAGE_CTL ));
+}
+
 static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel )
 {
     OSL_ENSURE( rSel.nStartPara==0 && rSel.nEndPara==0, "SetTopSelection: Para != 0" );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index c69dae4a98a0..dca31015375a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1108,7 +1108,13 @@ void ScTextWnd::StartEditEngine()
 
     ScInputHandler* pHdl = mpViewShell->GetInputHandler();
     if (pHdl)
+    {
+        bool bStarting = !pHdl->IsEditMode();
         pHdl->SetMode(SC_INPUT_TOP);
+        if (bStarting)
+            // necessary to sync SvxAutoCorrect behavior
+            pHdl->MergeLanguageAttributes( *mpEditEngine);
+    }
 
     SfxViewFrame* pViewFrm = SfxViewFrame::Current();
     if (pViewFrm)
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 0301b0a72056..99fd54f299a2 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -180,6 +180,7 @@ public:
     const ScAddress& GetCursorPos() const   { return aCursorPos; }
 
     bool            GetTextAndFields( ScEditEngineDefaulter& rDestEngine );
+    void            MergeLanguageAttributes( ScEditEngineDefaulter& rDestEngine ) const;
 
     bool            KeyInput( const KeyEvent& rKEvt, bool bStartEdit );
     void            EnterHandler( ScEnterMode nBlockMode = ScEnterMode::NORMAL );


More information about the Libreoffice-commits mailing list