summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-02-20 09:57:52 -0400
committerAndras Timar <andras.timar@collabora.com>2016-06-12 21:25:37 +0200
commit95f8c926591053a8c05690057a4ef585909aa0bf (patch)
tree0f7495d787a8c9471c1d98103b41fcf2332d1e3f /sd/qa/unit
parent9e10561b2edc9d201117a8307614673bb7bdae33 (diff)
sd lok: re-work LOK_CALLBACK_PARTS_COUNT_CHANGED callback
In the tiled rendering case, slide sorted view is not created. This revert some portion commit 80d7c5859b9e7a834a915d7e8bbbe9bc2130108a Reviewed-on: https://gerrit.libreoffice.org/22542 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com> (cherry picked from commit 286adeb032df8ab30930b6f76f75b342a3fa314b) Change-Id: Ifc2b7535f36ca69268de3e462bdd50ade9ec3853
Diffstat (limited to 'sd/qa/unit')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx62
1 files changed, 10 insertions, 52 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 1d3faec5a559..b678e1ab32ed 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -27,9 +27,6 @@
#include <comphelper/lok.hxx>
#include <svx/svdotable.hxx>
-#include <ImpressViewShellBase.hxx>
-#include <SlideSorterViewShell.hxx>
-#include <SlideSorter.hxx>
#include <DrawDocShell.hxx>
#include <ViewShell.hxx>
#include <sdpage.hxx>
@@ -50,7 +47,7 @@ public:
virtual void tearDown() override;
#if !defined(WNT) && !defined(MACOSX)
- void testInsertPage();
+ void testInsertDeletePage();
void testRegisterCallback();
void testPostKeyEvent();
void testPostMouseEvent();
@@ -69,7 +66,7 @@ public:
CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
#if !defined(WNT) && !defined(MACOSX)
- CPPUNIT_TEST(testInsertPage);
+ CPPUNIT_TEST(testInsertDeletePage);
CPPUNIT_TEST(testRegisterCallback);
CPPUNIT_TEST(testPostKeyEvent);
CPPUNIT_TEST(testPostMouseEvent);
@@ -649,56 +646,22 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
CPPUNIT_ASSERT_EQUAL(OString("match"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
}
-void SdTiledRenderingTest::testInsertPage()
+void SdTiledRenderingTest::testInsertDeletePage()
{
- uno::Sequence<beans::PropertyValue> aFilterOptions;
- uno::Reference<frame::XDesktop2> xLoader(mxDesktop, uno::UNO_QUERY);
- CPPUNIT_ASSERT(xLoader.is());
-
- uno::Reference<lang::XComponent> xComponent;
- xComponent = xLoader->loadComponentFromURL(
- getURLFromSrc(DATA_DIRECTORY) + OUString("insert-delete.odp"),
- "_blank",
- 0,
- aFilterOptions);
- CPPUNIT_ASSERT(xComponent.is());
-
- SfxObjectShell* pFoundShell = SfxObjectShell::GetShellFromComponent(xComponent);
- CPPUNIT_ASSERT(pFoundShell);
-
- ::sd::DrawDocShell* xDocSh = dynamic_cast<sd::DrawDocShell*>(pFoundShell);
- CPPUNIT_ASSERT(xDocSh);
-
- sd::ViewShell* pViewShell = xDocSh->GetViewShell();
- CPPUNIT_ASSERT(pViewShell);
-
- sd::slidesorter::SlideSorterViewShell* pSSVS = nullptr;
- for (int i = 0; i < 1000; i++)
- {
- // Process all Tasks - slide sorter is created here
- while (Scheduler::ProcessTaskScheduling(true));
- if ((pSSVS = sd::slidesorter::SlideSorterViewShell::GetSlideSorter(pViewShell->GetViewShellBase())) != nullptr)
- break;
- TimeValue aSleep(0, 100 * 1000000); // 100 msec
- osl::Thread::wait(aSleep);
- }
- CPPUNIT_ASSERT(pSSVS);
-
comphelper::LibreOfficeKit::setActive();
- SdXImpressDocument* pXImpressDocument = SdXImpressDocument::getImplementation(xDocSh->GetModel());
- CPPUNIT_ASSERT(pXImpressDocument);
+ SdXImpressDocument* pXImpressDocument = createDoc("insert-delete.odp");
+ pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this);
+
SdDrawDocument *pDoc = pXImpressDocument->GetDocShell()->GetDoc();
CPPUNIT_ASSERT(pDoc);
// the document has 1 slide
CPPUNIT_ASSERT(pDoc->GetSdPageCount(PK_STANDARD) == 1);
- pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this);
-
uno::Sequence<beans::PropertyValue> aArgs;
// Insert slides
- for(unsigned nIterator=1; nIterator <= 10; nIterator++)
+ for(unsigned it = 1; it <= 10; it++)
comphelper::dispatchCommand(".uno:InsertPage", aArgs);
// Verify inserted slides
@@ -711,7 +674,7 @@ void SdTiledRenderingTest::testInsertPage()
m_aPageList.clear();
// Delete slides
- for(unsigned nIterator=1; nIterator <= 10; nIterator++)
+ for(unsigned it = 1; it <= 10; it++)
comphelper::dispatchCommand(".uno:DeletePage", aArgs);
// Verify deleted slides
@@ -724,7 +687,7 @@ void SdTiledRenderingTest::testInsertPage()
m_aPageList.clear();
// Undo deleted slides
- for(unsigned nIterator=1; nIterator <= 10; nIterator++)
+ for(unsigned it = 1; it <= 10; it++)
comphelper::dispatchCommand(".uno:Undo", aArgs);
// Verify inserted slides
@@ -737,7 +700,7 @@ void SdTiledRenderingTest::testInsertPage()
m_aPageList.clear();
// Redo deleted slides
- for(unsigned nIterator=1; nIterator <= 10; nIterator++)
+ for(unsigned it = 1; it <= 10; it++)
comphelper::dispatchCommand(".uno:Redo", aArgs);
// Verify deleted slides
@@ -751,12 +714,7 @@ void SdTiledRenderingTest::testInsertPage()
CPPUNIT_ASSERT(pDoc->GetSdPageCount(PK_STANDARD) == 1);
comphelper::LibreOfficeKit::setActive(false);
-
- uno::Reference<util::XCloseable> xClose(xComponent, uno::UNO_QUERY);
- CPPUNIT_ASSERT(xClose.is());
- xClose->close(false);
}
-
#endif
CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);