summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-07-06 04:10:39 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-09-08 10:30:25 +0200
commit89a282e874a706a6f7265218f476e3948dbaa10c (patch)
treeee21a82e075909a91ed382e46e65269bd5d51f7e
parent70cd6cac6c1fe2f13702d8ab539d56ebae93683b (diff)
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@collabora.com>
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx9
1 files changed, 9 insertions, 0 deletions
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)