[Libreoffice-commits] core.git: 2 commits - sw/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 1 17:45:51 UTC 2019
sw/source/uibase/shells/textsh1.cxx | 45 -----------------------------------
sw/source/uibase/uiview/viewling.cxx | 4 +--
2 files changed, 3 insertions(+), 46 deletions(-)
New commits:
commit addb177559778d771f0eec92ae173552d8e1a1e5
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: Sun Dec 1 18:45:05 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>
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 );
}
}
commit 18cd65bebe27dbaa5cb0a079f0b3df09c9e12ec5
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Nov 29 15:23:19 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sun Dec 1 18:44:56 2019 +0100
Remove unused variable.
Change-Id: I34a15cb1e457c3ac0329e5ba735ac93db99e9fbf
Reviewed-on: https://gerrit.libreoffice.org/84154
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index 441964d1c9c9..701c819a80e9 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -792,7 +792,6 @@ bool SwView::ExecSpellPopup(const Point& rPt)
}
else
{
- boost::property_tree::ptree aMenu = SfxDispatcher::fillPopupMenu(&xPopup->GetMenu());
xPopup->Execute(aToFill.SVRect(), m_pEditWin);
}
}
More information about the Libreoffice-commits
mailing list