summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-10 14:02:52 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-12 22:06:22 -0400
commitaa2591f506f0ce55ecdb28020adce5a0c92bcfc4 (patch)
treec2428200a96b0dcf50c23ea11b4bb23396fd103d /sw
parent9b80b025f0b21cd74ee475c7f5c2d2d5a22ab652 (diff)
sw: implement per-view LOK_CALLBACK_SEARCH_RESULT_SELECTION
This way searching in one view does not affect the search state of an other view. Change-Id: I6d873b1609a8f6cb3cfe07e1f2fa92024c3545d9 Reviewed-on: https://gerrit.libreoffice.org/26161 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 52696e31e740d4076092f89531e58d11538f478f)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx29
1 files changed, 20 insertions, 9 deletions
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index bc922495e0f0..c2eee692ff36 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -140,7 +140,10 @@ static void lcl_emitSearchResultCallbacks(SvxSearchItem* pSearchItem, SwWrtShell
boost::property_tree::write_json(aStream, aTree);
OString aPayload = aStream.str().c_str();
- pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
+ else
+ pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
}
}
@@ -283,8 +286,10 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#if HAVE_FEATURE_DESKTOP
if( !bApi )
{
- m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
- m_pSrchItem->GetSearchString().toUtf8().getStr());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
+ else
+ m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif
@@ -405,8 +410,10 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#if HAVE_FEATURE_DESKTOP
if( !bApi )
{
- m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
- m_pSrchItem->GetSearchString().toUtf8().getStr());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
+ else
+ m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif
@@ -604,8 +611,10 @@ bool SwView::SearchAndWrap(bool bApi)
if( !bApi )
{
#if HAVE_FEATURE_DESKTOP
- m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
- m_pSrchItem->GetSearchString().toUtf8().getStr());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
+ else
+ m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
#endif
}
@@ -658,8 +667,10 @@ bool SwView::SearchAndWrap(bool bApi)
}
else if(!bApi)
{
- m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND,
- m_pSrchItem->GetSearchString().toUtf8().getStr());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ m_pWrtShell->GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
+ else
+ m_pWrtShell->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, m_pSrchItem->GetSearchString().toUtf8().getStr());
SvxSearchDialogWrapper::SetSearchLabel(SL_NotFound);
}
#endif