summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/ui/inc/olmenu.hxx3
-rw-r--r--sw/source/ui/lingu/olmenu.cxx16
2 files changed, 18 insertions, 1 deletions
diff --git a/sw/source/ui/inc/olmenu.hxx b/sw/source/ui/inc/olmenu.hxx
index 3da80f36238e..21744db98eab 100644
--- a/sw/source/ui/inc/olmenu.hxx
+++ b/sw/source/ui/inc/olmenu.hxx
@@ -51,6 +51,9 @@ class SwSpellPopup : public PopupMenu
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellAlternatives > xSpellAlt;
+ ::com::sun::star::linguistic2::ProofreadingResult xGrammarResult;
+ sal_Int32 nGrammarError;
+
::com::sun::star::uno::Sequence< rtl::OUString > aSuggestions;
rtl::OUString sExplanationLink;
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 393585808b17..1617d63bd720 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -567,12 +567,14 @@ SwSpellPopup::SwSpellPopup(
const String &rParaText ) :
PopupMenu( SW_RES(MN_SPELL_POPUP) ),
pSh( pWrtSh ),
+xGrammarResult( rResult ),
aSuggestions( rSuggestions ),
sExplanationLink( ),
bGrammarResults( true ),
aInfo16( SW_RES(IMG_INFO_16) )
{
nCheckedLanguage = SvxLocaleToLanguage( rResult.aLocale );
+ nGrammarError = nErrorInResult;
bool bUseImagesInMenus = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus();
sal_uInt16 nPos = 0;
@@ -806,8 +808,20 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
else if (nId == MN_IGNORE_SELECTION)
{
SwPaM *pPaM = pSh->GetCrsr();
- if (pPaM)
+ if (pPaM) {
+ if (bGrammarResults) {
+ try
+ {
+ xGrammarResult.xProofreader->ignoreRule(
+ xGrammarResult.aErrors[ nGrammarError ].aRuleIdentifier,
+ xGrammarResult.aLocale );
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ }
pSh->IgnoreGrammarErrorAt( *pPaM );
+ }
}
else if (nId == MN_IGNORE_WORD)
{