[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 2 17:18:51 UTC 2019
sw/source/uibase/shells/textsh1.cxx | 45 -----------------------------------
sw/source/uibase/uiview/viewling.cxx | 3 +-
2 files changed, 3 insertions(+), 45 deletions(-)
New commits:
commit bae671f4cafde408ea7dd7d4b621365b0e5e924c
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 29 18:19:58 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Dec 2 18:17:58 2019 +0100
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 at collabora.com>
(cherry picked from commit addb177559778d771f0eec92ae173552d8e1a1e5)
Reviewed-on: https://gerrit.libreoffice.org/84238
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 7e071c41adcf..d69e47c6ebd9 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1425,37 +1425,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 );
@@ -1530,19 +1499,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 c954dce5bbd8..d77faa042104 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -787,7 +787,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 );
}
}
More information about the Libreoffice-commits
mailing list