[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 8 08:32:21 UTC 2021
sw/source/uibase/uiview/viewsrch.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit eeda6c57b14838e4a7381b5cd89505842acbf507
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Jul 6 04:10:39 2021 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Sep 8 10:31:48 2021 +0200
explicitly send LOK_CALLBACK_TEXT_SELECTION at the end of FindAll
It normally gets emitted by SwSelPaintRects::Show(), called from
paiting, but Online uses tiled painting and so doesn't need normal
painting.
Change-Id: If276ce176f4e65b4efe3d053941b83917df2ae1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119268
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index a0cd2967fad5..8db4ff0134bb 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -34,6 +34,7 @@
#include <svl/srchitem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
+#include <sfx2/lokhelper.hxx>
#include <svx/srchdlg.hxx>
#include <edtwin.hxx>
#include <swmodule.hxx>
@@ -94,6 +95,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW
return;
std::vector<OString> aMatches;
+ OString textSelection;
for (SwPaM& rPaM : pPaM->GetRingContainer())
{
if (SwShellCursor* pShellCursor = dynamic_cast<SwShellCursor*>(&rPaM))
@@ -109,6 +111,7 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW
}
OString sRect = comphelper::string::join("; ", aRect);
aMatches.push_back(sRect);
+ textSelection = sRect;
}
}
boost::property_tree::ptree aTree;
@@ -121,6 +124,12 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem const * pSearchItem, SwW
OString aPayload = aStream.str().c_str();
pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
+
+ if(bHighlightAll)
+ { // FindAll disables this during find, do it once when done.
+ pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, textSelection.getStr());
+ SfxLokHelper::notifyOtherViews(pWrtShell->GetSfxViewShell(), LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection", textSelection);
+ }
}
void SwView::ExecSearch(SfxRequest& rReq)
More information about the Libreoffice-commits
mailing list