diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2020-03-16 17:20:22 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2020-03-17 11:17:25 +0100 |
commit | a00a3d681ec95841a5f6a879b05c6438d18161b4 (patch) | |
tree | 1a1195ca8c80cfca5d3b6eea04f42e658bc3d30f /sd/source/ui/docshell/docshel3.cxx | |
parent | 268327c2fb37ff553a2c348a6beca4e309b0653f (diff) |
sd lok: Implement execution of SID_SPELLCHECK_APPLY_SUGGESTION
Used by online spellchecking context menu.
Change-Id: I9d7430b4ef45af1641fc985cf4588d45ba497ee9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90598
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/source/ui/docshell/docshel3.cxx')
-rw-r--r-- | sd/source/ui/docshell/docshel3.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 66b0daaa0736..eeef7c8dbe8c 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -381,6 +381,27 @@ void DrawDocShell::Execute( SfxRequest& rReq ) } } break; + case SID_SPELLCHECK_APPLY_SUGGESTION: + { + SdrView* pSdrView = mpViewShell->GetDrawView(); + if (!pSdrView) + return; + + EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView(); + OUString sApplyText; + const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1); + if (pItem2) + sApplyText = pItem2->GetValue(); + + const OUString sSpellingRule("Spelling_"); + sal_Int32 nPos = 0; + if(-1 != (nPos = sApplyText.indexOf( sSpellingRule ))) + { + sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), ""); + rEditView.InsertText( sApplyText ); + } + } + break; case SID_NOTEBOOKBAR: { |