diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-27 11:59:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-28 09:42:37 +0200 |
commit | f953b28a945b7e61bc3407f2147e5afd3a11a2ff (patch) | |
tree | 185e1c14c4e7728467003692b1a3f83f152f00c5 /sd | |
parent | d7bd82f9c268ec76df07e8b5d74effe19009484e (diff) |
CppunitTest_sd_tiledrendering: add part switching testcase
Fails with the last hunk of commit
67a37be9969d8b5a0bc8ae081bc1aba697ea6ba5 (sd: fix LOK search result
highlight when result is not on the current slide, 2015-05-26) reverted.
Change-Id: I5f8b57784ad1de1434113af7f94c9fde8672b4d5
(cherry picked from commit a0576aec8381ca8ea36d60c925e871587702c268)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/data/dummy.odp | bin | 10303 -> 10727 bytes | |||
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 36 |
2 files changed, 30 insertions, 6 deletions
diff --git a/sd/qa/unit/tiledrendering/data/dummy.odp b/sd/qa/unit/tiledrendering/data/dummy.odp Binary files differindex e559de627cec..12cd67947df5 100644 --- a/sd/qa/unit/tiledrendering/data/dummy.odp +++ b/sd/qa/unit/tiledrendering/data/dummy.odp diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index a55b026f2d52..98890150dd97 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -37,6 +37,7 @@ static const char* DATA_DIRECTORY = "/sd/qa/unit/tiledrendering/data/"; class SdTiledRenderingTest : public test::BootstrapFixture, public unotest::MacrosTest, public XmlTestTools { public: + SdTiledRenderingTest(); virtual void setUp() SAL_OVERRIDE; virtual void tearDown() SAL_OVERRIDE; @@ -73,9 +74,17 @@ private: #if !defined(WNT) && !defined(MACOSX) Rectangle m_aInvalidation; std::vector<Rectangle> m_aSelection; + sal_Int32 m_nPart; #endif }; +SdTiledRenderingTest::SdTiledRenderingTest() +#if !defined(WNT) && !defined(MACOSX) + : m_nPart(0) +#endif +{ +} + void SdTiledRenderingTest::setUp() { test::BootstrapFixture::setUp(); @@ -158,6 +167,12 @@ void SdTiledRenderingTest::callbackImpl(int nType, const char* pPayload) } } break; + case LOK_CALLBACK_SET_PART: + { + OUString aPayload = OUString::createFromAscii(pPayload); + m_nPart = aPayload.toInt32(); + } + break; } } @@ -306,6 +321,16 @@ void SdTiledRenderingTest::testResetSelection() CPPUNIT_ASSERT(!pView->GetTextEditObject()); } +static void lcl_search(const OUString& rKey) +{ + uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( + { + {"SearchItem.SearchString", uno::makeAny(rKey)}, + {"SearchItem.Backward", uno::makeAny(false)} + })); + comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); +} + void SdTiledRenderingTest::testSearch() { SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); @@ -314,12 +339,7 @@ void SdTiledRenderingTest::testSearch() uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); xShape->setString("Aaa bbb."); - uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( - { - {"SearchItem.SearchString", uno::makeAny(OUString("bbb"))}, - {"SearchItem.Backward", uno::makeAny(false)} - })); - comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); + lcl_search("bbb"); sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdrView* pView = pViewShell->GetView(); @@ -329,6 +349,10 @@ void SdTiledRenderingTest::testSearch() // Did the selection callback fire? CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), m_aSelection.size()); + + // Search for something on the second slide, and make sure that the set-part callback fired. + lcl_search("bbb"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), m_nPart); } #endif |