summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2012-11-10 16:37:55 +0100
committerNémeth László <nemeth@numbertext.org>2012-11-13 13:02:34 +0000
commita2020262db475dc5e4af0c2692946e878ea4842a (patch)
tree0d27ff6f5cd3037d2516145430e6aae10f3ac439
parent4afc70d295399e9e978053c2ae7d2fe29371abd5 (diff)
fdo#56954: fix Ignore menu item of grammar mistakes
Change-Id: I5cec602c686d5199b516a7e5135ababeb0751444 Reviewed-on: https://gerrit.libreoffice.org/1024 Reviewed-by: Németh László <nemeth@numbertext.org> Tested-by: Németh László <nemeth@numbertext.org>
-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)
{