summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-08-24 16:34:55 +0200
committerEike Rathke <erack@redhat.com>2017-08-24 16:37:15 +0200
commitd31a8263d564ebd7886f6debdf36cedd031915ea (patch)
tree494dbabd49cdd5d9a5cbb44ce28fa35894e58707
parent73ee631e58f392415f23e98460ff4b2f3a763d37 (diff)
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@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/app/inputhdl.cxx8
-rw-r--r--sc/source/ui/app/inputwin.cxx6
-rw-r--r--sc/source/ui/inc/inputhdl.hxx1
3 files changed, 15 insertions, 0 deletions
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 );