summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-06 14:17:43 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-06 14:18:12 +0200
commit58c38e7ea5debc5440f1d81acf38d8d6ad0883d8 (patch)
treee957f5cd8e2de56160a40a5817440eab176a7079
parentca8016c3a317a7ba1f03e117d575fb78a572b4b3 (diff)
sw tiled rendering: emit LOK_CALLBACK_SEARCH_RESULT* for normal search
We used to emit these for find-all only, for no good reason. Change-Id: Id07dc7649f9a8528b9d4ec16d5f7c651fd607111
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx7
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx4
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 2fd27dd4f8ff..1eb57dea109e 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -342,7 +342,10 @@ void lcl_search(bool bBackward)
void SwTiledRenderingTest::testSearch()
{
#if !defined(WNT) && !defined(MACOSX)
+ comphelper::LibreOfficeKit::setActive();
+
SwXTextDocument* pXTextDocument = createDoc("search.odt");
+ pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
size_t nNode = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
@@ -351,6 +354,8 @@ void SwTiledRenderingTest::testSearch()
CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject());
size_t nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
+ /// Make sure we get search result selection for normal find as well, not only find all.
+ CPPUNIT_ASSERT(!m_aSearchResultSelection.empty());
// Next hit, in the shape.
lcl_search(false);
@@ -375,6 +380,8 @@ void SwTiledRenderingTest::testSearch()
CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject());
nActual = pWrtShell->getShellCrsr(false)->Start()->nNode.GetNode().GetIndex();
CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual);
+
+ comphelper::LibreOfficeKit::setActive(false);
#endif
}
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 7d34a2ab819c..3427fe4b55e6 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -253,7 +253,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
{
bool bRet = SearchAndWrap(bApi);
if( bRet )
+ {
Scroll(m_pWrtShell->GetCharRect().SVRect());
+ if (comphelper::LibreOfficeKit::isActive())
+ lcl_emitSearchResultCallbacks(1, m_pSrchItem, m_pWrtShell);
+ }
rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
#if HAVE_FEATURE_DESKTOP
{