[Libreoffice-commits] core.git: sd/sdi sd/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 17 10:18:02 UTC 2020


 sd/sdi/_docsh.sdi                  |    6 ++++++
 sd/source/ui/docshell/docshel3.cxx |   21 +++++++++++++++++++++
 2 files changed, 27 insertions(+)

New commits:
commit a00a3d681ec95841a5f6a879b05c6438d18161b4
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Mar 16 17:20:22 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Mar 17 11:17:25 2020 +0100

    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 at collabora.com>

diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 8644b752702c..02de70858ab0 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -83,5 +83,11 @@ interface DrawDocument
         ExecMethod = Execute ;
         StateMethod = GetState ;
     ]
+
+    SID_SPELLCHECK_APPLY_SUGGESTION
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+    ]
 }
 
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:
         {


More information about the Libreoffice-commits mailing list