diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-06 14:17:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-07 12:01:14 +0200 |
commit | 2af2b87c0ba14bdd810988f347c37dc15b3daf01 (patch) | |
tree | 0dc2583747b2cd171531af3507c51e9635fac0a7 /sw | |
parent | 88e5154b9af6a5385d37d97fa22de2c131a214eb (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
(cherry picked from commit 58c38e7ea5debc5440f1d81acf38d8d6ad0883d8)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 4 |
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 a22cbdb6528f..c8d3e7a571ea 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 { |