[Libreoffice-commits] core.git: sw/source
Luboš Luňák (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 8 08:30:59 UTC 2021
sw/source/uibase/uiview/viewsrch.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 89a282e874a706a6f7265218f476e3948dbaa10c
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:30:25 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/+/119382
Tested-by: Jenkins
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 643b5b58f230..66fb79ac3809 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 <swmodule.hxx>
#include <swwait.hxx>
@@ -93,6 +94,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))
@@ -108,6 +110,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;
@@ -120,6 +123,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