diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-07-06 04:10:39 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-08 10:31:48 +0200 |
commit | eeda6c57b14838e4a7381b5cd89505842acbf507 (patch) | |
tree | 5883c3b1a28ee1ff1ee236a560152ddd7baa567c /sw/source | |
parent | 5ad6bfb54ffec15fe311ed990aa1518979b8f086 (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/+/119268
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
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) |