summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@libreoffice.org>2022-05-06 19:37:14 -0400
committerKohei Yoshida <kohei@libreoffice.org>2022-05-07 04:52:50 +0200
commitf15e6293cf78d67963a6e512f60a11ae58da72c5 (patch)
tree777fd99553c788309747c539a0d5f49565bd2225 /svx
parent431c692e4e58a4861e4ab7b4d30b1edf0aab0496 (diff)
tdf#107765: Check the updated language and apply it to the cell.
During the normal spell-checking in Calc, the user may change the language on the string segment with a spelling error, which is supposed to be applied back to that segment in the cell, but was not. This change should fix it. In case the new language is applied to the entire cell string, we will set the new lanuage to the cell as a cell attribute and keep the string as a simple string. Otherwise, the new language gets applied to the edit engine string. This commit also changes the return value of EditEngine::GetLanguage() to include the string span information in addition to the language value. Change-Id: I713ec7aefe571f721321cd8ea687f616ab4dd61a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133966 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/weldeditview.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index 42eb22c12223..4d900093b044 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -1190,7 +1190,7 @@ SfxItemState WeldTextForwarder::GetItemState(sal_Int32 nPara, sal_uInt16 nWhich)
LanguageType WeldTextForwarder::GetLanguage(sal_Int32 nPara, sal_Int32 nIndex) const
{
EditEngine* pEditEngine = m_rEditAcc.GetEditEngine();
- return pEditEngine ? pEditEngine->GetLanguage(nPara, nIndex) : LANGUAGE_NONE;
+ return pEditEngine ? pEditEngine->GetLanguage(nPara, nIndex).nLang : LANGUAGE_NONE;
}
sal_Int32 WeldTextForwarder::GetFieldCount(sal_Int32 nPara) const