diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-15 16:56:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-16 11:33:40 +0200 |
commit | 66f33819810e50ee39d468789edd4b6839d28d12 (patch) | |
tree | f2f8fe60719dea5c2073cfee7ed9ac949f049772 /sd | |
parent | d1a3aae419c63fe93a280cf265716b857a02858f (diff) |
sd tiled rendering: implement CALLBACK_SET_PART for find-all
Change-Id: I607b3719e0f508f9ae24db7482323847aa8e2491
(cherry picked from commit 6a35a75a6bb2753f40edf59f360130e452b3c7f0)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/data/search-all.odp | bin | 10744 -> 10938 bytes | |||
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/data/search-all.odp b/sd/qa/unit/tiledrendering/data/search-all.odp Binary files differindex cb3cb31cf5c7..0fd069ce6c0b 100644 --- a/sd/qa/unit/tiledrendering/data/search-all.odp +++ b/sd/qa/unit/tiledrendering/data/search-all.odp diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 586263e61471..0af3bf9a9594 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -421,12 +421,19 @@ void SdTiledRenderingTest::testSearch() void SdTiledRenderingTest::testSearchAll() { SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp"); + pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this); lcl_search("match", /*bFindAll=*/true); OString aUsedFormat; // This was empty: find-all did not highlight the first match. CPPUNIT_ASSERT_EQUAL(OString("match"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat)); + + // We're on the first slide, search for something on the second slide and make sure we get a SET_PART. + m_nPart = 0; + lcl_search("second", /*bFindAll=*/true); + // This was 0: no SET_PART was emitted. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), m_nPart); } #endif diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 581d9d28b639..ab7fc9c1c3e8 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -673,6 +673,14 @@ bool Outliner::SearchAndReplaceAll() } RestoreStartPosition (); + + if (mpSearchItem->GetCommand() == SvxSearchCmd::FIND_ALL && pViewShell->GetDoc()->isTiledRendering() && !bRet) + { + // Find-all, tiled rendering and we have at least one match. + OString aPayload = OString::number(mnStartPageIndex); + pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + } + mnStartPageIndex = (sal_uInt16)-1; return bRet; |