summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-15 16:56:14 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-15 16:56:14 +0200
commit6a35a75a6bb2753f40edf59f360130e452b3c7f0 (patch)
treea2183384dad41a604c9a7d61f4e4a13c369aee3a /sd
parentcd4976988cf3acb4f1a23f1df7fcc2bfec0f3da0 (diff)
sd tiled rendering: implement CALLBACK_SET_PART for find-all
Change-Id: I607b3719e0f508f9ae24db7482323847aa8e2491
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/data/search-all.odpbin10744 -> 10938 bytes
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx7
-rw-r--r--sd/source/ui/view/Outliner.cxx8
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
index cb3cb31cf5c7..0fd069ce6c0b 100644
--- a/sd/qa/unit/tiledrendering/data/search-all.odp
+++ b/sd/qa/unit/tiledrendering/data/search-all.odp
Binary files differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 89a2bf11b228..1073d14b160e 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 8c79ac4048ac..4ccd33c833a5 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -667,6 +667,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;