summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-11-29 18:19:58 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-12-01 18:45:05 +0100
commitaddb177559778d771f0eec92ae173552d8e1a1e5 (patch)
tree5f54724e73351e97785a6468df502a6ee11a2c3b
parent18cd65bebe27dbaa5cb0a079f0b3df09c9e12ec5 (diff)
SpellingPopup: lok: keep the selection to make context menu work.
Change-Id: Ida46a1140c889d1864b423eb9c5512d99a028fce Reviewed-on: https://gerrit.libreoffice.org/84155 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sw/source/uibase/shells/textsh1.cxx45
-rw-r--r--sw/source/uibase/uiview/viewling.cxx3
2 files changed, 3 insertions, 45 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index dce1531b94ef..a8e329b806b4 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1436,37 +1436,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case SID_SPELLCHECK_IGNORE:
{
- // If there is not selection, we need to create one, before ignoring
- if(!rWrtSh.HasSelection())
- {
- OUString sApplyText;
- const SfxStringItem* pItem2 = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
- if (pItem2)
- sApplyText = pItem2->GetValue();
-
- const OUString sGrammarType("Grammar");
- const OUString sSpellingType("Spelling");
-
- if (sApplyText == sGrammarType)
- {
- linguistic2::ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorInResult = -1;
- uno::Sequence< OUString > aSuggestions;
- sal_Int32 nErrorPosInText = -1;
- SwRect aToFill;
- bool bCorrectionRes = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
- if (!bCorrectionRes)
- return;
- }
- else if (sApplyText == sSpellingType)
- {
- SwRect aToFill;
- uno::Reference< linguistic2::XSpellAlternatives > xSpellAlt( rWrtSh.GetCorrection(nullptr, aToFill) );
- if (!xSpellAlt.is())
- return;
- }
- }
-
SwPaM *pPaM = rWrtSh.GetCursor();
if (pPaM)
SwEditShell::IgnoreGrammarErrorAt( *pPaM );
@@ -1541,19 +1510,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
if(-1 != (nPos = sApplyText.indexOf( sGrammarRule )))
{
sApplyText = sApplyText.replaceAt(nPos, sGrammarRule.getLength(), "");
- if(rWrtSh.HasSelection())
- {
- bGrammar = true;
- }
- else
- {
- linguistic2::ProofreadingResult aGrammarCheckRes;
- sal_Int32 nErrorInResult = -1;
- uno::Sequence< OUString > aSuggestions;
- sal_Int32 nErrorPosInText = -1;
- SwRect aToFill;
- bGrammar = rWrtSh.GetGrammarCorrection( aGrammarCheckRes, nErrorPosInText, nErrorInResult, aSuggestions, nullptr, aToFill );
- }
+ bGrammar = true;
}
else if (-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
{
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 701c819a80e9..6e4b6b034517 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -798,7 +798,8 @@ bool SwView::ExecSpellPopup(const Point& rPt)
}
}
- m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
+ if (!comphelper::LibreOfficeKit::isActive())
+ m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
m_pWrtShell->LockView( bOldViewLock );
}
}