summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2020-03-16 17:14:33 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2020-03-17 13:16:44 +0100
commit32cc18c985b49d14553ce335d903a5305534e18b (patch)
treec96d151e07e7dcdd75aff26ff7e42fd8f33f9ee6
parenta9fff9be8ef9dbbe8097a48669475db9146d2a30 (diff)
sd lok: Implement execution of SID_SPELLCHECK_IGNORE_ALL
Used by online spellchecking context menu. Change-Id: Iad3dafedbfed1605ba06f7f87ed91117c9b1a8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90597 Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 268327c2fb37ff553a2c348a6beca4e309b0653f)
-rw-r--r--editeng/source/editeng/editview.cxx5
-rw-r--r--include/editeng/editview.hxx1
-rw-r--r--sd/sdi/_docsh.sdi6
-rw-r--r--sd/source/ui/docshell/docshel3.cxx21
4 files changed, 33 insertions, 0 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 621a7d3bcfff..24d0947d7de5 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1199,6 +1199,11 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo
}
}
+OUString EditView::SpellIgnoreWord()
+{
+ return pImpEditView->SpellIgnoreWord();
+}
+
void EditView::SelectCurrentWord( sal_Int16 nWordType )
{
EditSelection aCurSel( pImpEditView->GetEditSelection() );
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 8d2a5ef2853d..b516e4484eb1 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -260,6 +260,7 @@ public:
bool IsCursorAtWrongSpelledWord();
bool IsWrongSpelledWordAtPos( const Point& rPosPixel, bool bMarkIfWrong = false );
void ExecuteSpellPopup( const Point& rPosPixel, Link<SpellCallbackInfo&,void> const * pCallBack );
+ OUString SpellIgnoreWord();
void InsertField( const SvxFieldItem& rFld );
const SvxFieldItem* GetFieldUnderMousePointer() const;
diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi
index 29db81db02d2..8644b752702c 100644
--- a/sd/sdi/_docsh.sdi
+++ b/sd/sdi/_docsh.sdi
@@ -77,5 +77,11 @@ interface DrawDocument
ExecMethod = Execute;
StateMethod = GetState;
]
+
+ SID_SPELLCHECK_IGNORE_ALL
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
}
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 212ca38c27eb..15a54620d071 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -373,6 +373,27 @@ void DrawDocShell::Execute( SfxRequest& rReq )
Broadcast(SfxHint(SfxHintId::LanguageChanged));
}
break;
+ case SID_SPELLCHECK_IGNORE_ALL:
+ {
+ SdrView* pSdrView = mpViewShell->GetDrawView();
+ if (!pSdrView)
+ return;
+
+ EditView& rEditView = pSdrView->GetTextEditOutlinerView()->GetEditView();
+ OUString sIgnoreText;
+ const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
+ if (pItem2)
+ sIgnoreText = pItem2->GetValue();
+
+ const OUString sSpellingType("Spelling");
+ if(sIgnoreText == sSpellingType)
+ {
+ ESelection aOldSel = rEditView.GetSelection();
+ rEditView.SpellIgnoreWord();
+ rEditView.SetSelection( aOldSel );
+ }
+ }
+ break;
case SID_NOTEBOOKBAR:
{