summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2019-03-08 12:35:15 +0100
committerAndras Timar <andras.timar@collabora.com>2019-03-08 12:35:15 +0100
commit267627002d54304c4e49b63d21dd906e79ebfa8d (patch)
treecc1a3b81c9b1350a47ba83aa49863f58fa213cf3 /sd
parent35c4f64a2d17dec439d6e6fc09a4fe25b0341953 (diff)
Revert "LOK: disable LOKit in unit-tests only after destroying all"
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx117
1 files changed, 113 insertions, 4 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 7e8c0f0b4a0a..1765db27be7d 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -198,8 +198,6 @@ void SdTiledRenderingTest::setUp()
{
test::BootstrapFixture::setUp();
- comphelper::LibreOfficeKit::setActive(true);
-
mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
}
@@ -211,8 +209,6 @@ void SdTiledRenderingTest::tearDown()
if (m_pXmlBuffer)
xmlBufferFree(m_pXmlBuffer);
- comphelper::LibreOfficeKit::setActive(false);
-
test::BootstrapFixture::tearDown();
}
@@ -343,6 +339,7 @@ xmlDocPtr SdTiledRenderingTest::parseXmlDump()
void SdTiledRenderingTest::testRegisterCallback()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -358,10 +355,12 @@ void SdTiledRenderingTest::testRegisterCallback()
CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
::tools::Rectangle aTopLeft(0, 0, 256*15, 256*15); // 1 px = 15 twips, assuming 96 DPI.
CPPUNIT_ASSERT(m_aInvalidation.IsOver(aTopLeft));
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testPostKeyEvent()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -386,10 +385,12 @@ void SdTiledRenderingTest::testPostKeyEvent()
rEditView.SetSelection(aWordSelection);
// Did we enter the expected character?
CPPUNIT_ASSERT_EQUAL(OUString("xx"), rEditView.GetSelected());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testPostMouseEvent()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -419,10 +420,12 @@ void SdTiledRenderingTest::testPostMouseEvent()
CPPUNIT_ASSERT(pView->GetTextEditObject());
// The new cursor position must be before the first word.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), rEditView.GetSelection().nStartPos);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSetTextSelection()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -447,10 +450,12 @@ void SdTiledRenderingTest::testSetTextSelection()
pXImpressDocument->setTextSelection(LOK_SETTEXTSELECTION_END, aEnd.getX(), aEnd.getY());
// The new selection must include the ending dot, too -- but not the first word.
CPPUNIT_ASSERT_EQUAL(OUString("bbb."), rEditView.GetSelected());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testGetTextSelection()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -471,10 +476,12 @@ void SdTiledRenderingTest::testGetTextSelection()
// Make sure returned RTF is not empty.
CPPUNIT_ASSERT(!pXImpressDocument->getTextSelection("text/rtf", aUsedFormat).isEmpty());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSetGraphicSelection()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pPage = pViewShell->GetActualPage();
@@ -504,10 +511,13 @@ void SdTiledRenderingTest::testSetGraphicSelection()
// Check that a resize happened, but aspect ratio is not kept.
CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth());
CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testUndoShells()
{
+ comphelper::LibreOfficeKit::setActive();
// Load a document and set the page size.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
@@ -525,10 +535,12 @@ void SdTiledRenderingTest::testUndoShells()
sal_Int32 nView1 = SfxLokHelper::getView();
// This was -1, SdUndoGroup did not track what view shell created it.
CPPUNIT_ASSERT_EQUAL(ViewShellId(nView1), pUndoManager->GetUndoAction()->GetViewShellId());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testResetSelection()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Reference<container::XIndexAccess> xDrawPage(pXImpressDocument->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
@@ -549,6 +561,7 @@ void SdTiledRenderingTest::testResetSelection()
// Now use resetSelection() to reset the selection.
pXImpressDocument->resetSelection();
CPPUNIT_ASSERT(!pView->GetTextEditObject());
+ comphelper::LibreOfficeKit::setActive(false);
}
static void lcl_search(const OUString& rKey, bool bFindAll = false)
@@ -564,6 +577,7 @@ static void lcl_search(const OUString& rKey, bool bFindAll = false)
void SdTiledRenderingTest::testSearch()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -593,10 +607,12 @@ void SdTiledRenderingTest::testSearch()
// This should trigger the not-found callback.
lcl_search("ccc");
CPPUNIT_ASSERT_EQUAL(false, m_bFound);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSearchAll()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -612,10 +628,12 @@ void SdTiledRenderingTest::testSearchAll()
lcl_search("second", /*bFindAll=*/true);
// This was 0: no SET_PART was emitted.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), m_nPart);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSearchAllSelections()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -625,10 +643,12 @@ void SdTiledRenderingTest::testSearchAllSelections()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), m_nPart);
// This was 1: only the first match was highlighted.
CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), m_aSelection.size());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSearchAllNotifications()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -638,10 +658,12 @@ void SdTiledRenderingTest::testSearchAllNotifications()
CPPUNIT_ASSERT_EQUAL(0, m_nSelectionBeforeSearchResult);
// But we do get the selection of the first hit.
CPPUNIT_ASSERT(m_nSelectionAfterSearchResult > 0);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testSearchAllFollowedBySearch()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -653,10 +675,12 @@ void SdTiledRenderingTest::testSearchAllFollowedBySearch()
// This used to give wrong result: 'search' after 'search all' still
// returned 'third'
CPPUNIT_ASSERT_EQUAL(OString("match"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testDontSearchInMasterPages()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -665,6 +689,8 @@ void SdTiledRenderingTest::testDontSearchInMasterPages()
// the master page)
lcl_search("date");
CPPUNIT_ASSERT_EQUAL(false, m_bFound);
+
+ comphelper::LibreOfficeKit::setActive(false);
}
namespace
@@ -687,6 +713,7 @@ std::vector<OUString> getCurrentParts(SdXImpressDocument* pDocument)
void SdTiledRenderingTest::testInsertDeletePage()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("insert-delete.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
pViewShell->GetViewShellBase().registerLibreOfficeKitViewCallback(&SdTiledRenderingTest::callback, this);
@@ -777,10 +804,13 @@ void SdTiledRenderingTest::testInsertDeletePage()
// the document has 1 slide
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(1), pDoc->GetSdPageCount(PageKind::Standard));
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testInsertTable()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
@@ -803,10 +833,13 @@ void SdTiledRenderingTest::testInsertTable()
CPPUNIT_ASSERT(aPos.X() != 0);
CPPUNIT_ASSERT(aPos.Y() != 0);
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testPartHash()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pDoc = createDoc("dummy.odp");
int nParts = pDoc->getParts();
@@ -817,11 +850,13 @@ void SdTiledRenderingTest::testPartHash()
// check part that it does not exists
CPPUNIT_ASSERT(pDoc->getPartHash(100).isEmpty());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testResizeTable()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("table.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -862,11 +897,13 @@ void SdTiledRenderingTest::testResizeTable()
sal_Int32 nActualRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
// Expected was 4000, actual was 4572, i.e. the second row after undo was larger than expected.
CPPUNIT_ASSERT_DOUBLES_EQUAL(nExpectedRow2, nActualRow2, 1.0);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testResizeTableColumn()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("table-column.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -913,6 +950,7 @@ void SdTiledRenderingTest::testResizeTableColumn()
CPPUNIT_ASSERT_EQUAL(nExpectedColumn2, nActualColumn2);
xmlFreeDoc(pXmlDoc);
pXmlDoc = nullptr;
+ comphelper::LibreOfficeKit::setActive(false);
}
/// A view callback tracks callbacks invoked on one specific view.
@@ -1021,6 +1059,8 @@ public:
void SdTiledRenderingTest::testViewCursors()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1043,10 +1083,14 @@ void SdTiledRenderingTest::testViewCursors()
CPPUNIT_ASSERT(aView2.m_bGraphicSelectionInvalidated);
mxComponent->dispose();
mxComponent.clear();
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testViewCursorParts()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1081,10 +1125,13 @@ void SdTiledRenderingTest::testViewCursorParts()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testCursorViews()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Create the first view.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
ViewCallback aView1;
@@ -1128,10 +1175,13 @@ void SdTiledRenderingTest::testCursorViews()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testViewLock()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Load a document that has a shape and create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1156,10 +1206,13 @@ void SdTiledRenderingTest::testViewLock()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testUndoLimiting()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Create the first view.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
sd::ViewShell* pViewShell1 = pXImpressDocument->GetDocShell()->GetViewShell();
@@ -1197,10 +1250,13 @@ void SdTiledRenderingTest::testUndoLimiting()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testCreateViewGraphicSelection()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Load a document and register a callback.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1234,10 +1290,13 @@ void SdTiledRenderingTest::testCreateViewGraphicSelection()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testCreateViewTextCursor()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Load a document and register a callback.
SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
ViewCallback aView1;
@@ -1288,11 +1347,13 @@ void SdTiledRenderingTest::testCreateViewTextCursor()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf102223()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf102223.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1328,11 +1389,14 @@ void SdTiledRenderingTest::testTdf102223()
rEditView2.SetSelection(ESelection(0, 0, 0, 1)); // start para, start char, end para, end char.
const SvxFontHeightItem& rItem2 = rEditView2.GetAttribs().Get(EE_CHAR_FONTHEIGHT);
CPPUNIT_ASSERT_EQUAL((int)1411, (int)rItem2.GetHeight());
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testPostKeyEventInvalidation()
{
// Load a document and begin text edit on the first slide.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("2slides.odp");
CPPUNIT_ASSERT_EQUAL(0, pXImpressDocument->getPart());
ViewCallback aView1;
@@ -1372,6 +1436,7 @@ void SdTiledRenderingTest::testPostKeyEventInvalidation()
mxComponent->dispose();
mxComponent.clear();
+ comphelper::LibreOfficeKit::setActive(false);
}
/**
@@ -1380,6 +1445,7 @@ void SdTiledRenderingTest::testPostKeyEventInvalidation()
void SdTiledRenderingTest::testTdf103083()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf103083.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1437,6 +1503,8 @@ void SdTiledRenderingTest::testTdf103083()
const SfxItemSet& rParagraphItemSet2 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2);
CPPUNIT_ASSERT_EQUAL((sal_uInt16)3, rParagraphItemSet2.Count());
+
+ comphelper::LibreOfficeKit::setActive(false);
}
/**
@@ -1445,6 +1513,7 @@ void SdTiledRenderingTest::testTdf103083()
void SdTiledRenderingTest::testTdf104405()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf104405.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1492,10 +1561,13 @@ void SdTiledRenderingTest::testTdf104405()
// the following name has a compiler-dependent part
CPPUNIT_ASSERT_EQUAL(getXPath(pXmlDoc, aPrefix, "value"), OUString("2"));
xmlFreeDoc(pXmlDoc);
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf81754()
{
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf81754.pptx");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1525,11 +1597,13 @@ void SdTiledRenderingTest::testTdf81754()
CPPUNIT_ASSERT_EQUAL(OUString("Somethingxx"), aEdit.GetText(0));
xDocShRef->DoClose();
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf105502()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf105502.odp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
sd::Window* pWindow = pViewShell->GetActiveWindow();
@@ -1580,11 +1654,13 @@ void SdTiledRenderingTest::testTdf105502()
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aLastCell.mnRow);
xmlFreeDoc(pXmlDoc);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testCommentCallbacks()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
// Set the tiled annotations off
comphelper::LibreOfficeKit::setTiledAnnotations(false);
@@ -1694,11 +1770,13 @@ void SdTiledRenderingTest::testCommentCallbacks()
mxComponent.clear();
comphelper::LibreOfficeKit::setTiledAnnotations(true);
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testMultiViewInsertDeletePage()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
ViewCallback aView1;
int nView1 = SfxLokHelper::getView();
@@ -1739,11 +1817,14 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
mxComponent->dispose();
mxComponent.clear();
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testDisableUndoRepair()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
SfxViewShell* pView1 = SfxViewShell::Current();
int nView1 = SfxLokHelper::getView();
@@ -1793,10 +1874,14 @@ void SdTiledRenderingTest::testDisableUndoRepair()
CPPUNIT_ASSERT(pUInt32Item);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue());
}
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testDocumentRepair()
{
+ comphelper::LibreOfficeKit::setActive();
+
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
CPPUNIT_ASSERT(pXImpressDocument);
@@ -1838,11 +1923,14 @@ void SdTiledRenderingTest::testDocumentRepair()
CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
}
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testLanguageStatus()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
createDoc("dummy.odp");
SfxViewShell* pView1 = SfxViewShell::Current();
SfxLokHelper::createView();
@@ -1855,11 +1943,15 @@ void SdTiledRenderingTest::testLanguageStatus()
CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(pItem1.get()));
CPPUNIT_ASSERT(dynamic_cast< const SfxStringItem* >(pItem2.get()));
}
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testDefaultView()
{
// Load the document with notes view.
+ comphelper::LibreOfficeKit::setActive();
+
SdXImpressDocument* pXImpressDocument = createDoc("notes-view.odp");
sd::ViewShell* pView = pXImpressDocument->GetDocShell()->GetViewShell();
{
@@ -1874,11 +1966,14 @@ void SdTiledRenderingTest::testDefaultView()
CPPUNIT_ASSERT_EQUAL(true, pImpressView->GetValue());
CPPUNIT_ASSERT_EQUAL(false, pNotesView->GetValue());
}
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testIMESupport()
{
// Load the document with notes view.
+ comphelper::LibreOfficeKit::setActive();
+
SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
VclPtr<vcl::Window> pDocWindow = pXImpressDocument->getDocWindow();
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
@@ -1911,11 +2006,14 @@ void SdTiledRenderingTest::testIMESupport()
rEditView.SetSelection(aWordSelection);
// content contains only the last IME composition, not all
CPPUNIT_ASSERT_EQUAL(OUString("x").concat(aInputs[aInputs.size() - 1]), rEditView.GetSelected());
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf115783()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("tdf115783.fodp");
sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdPage* pActualPage = pViewShell->GetActualPage();
@@ -1977,11 +2075,14 @@ void SdTiledRenderingTest::testTdf115783()
int nHeight = xPropertySet->getPropertyValue("CharHeight").get<float>();
// Make sure that the single font size for the cell is the expected one.
CPPUNIT_ASSERT_EQUAL(12, nHeight);
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testPasteTextOnSlide()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("paste_text_onslide.odp");
CPPUNIT_ASSERT(pXImpressDocument);
@@ -2039,10 +2140,13 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
Point aPos = pTextObj->GetLastBoundRect().TopLeft();
CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(12990), aPos.getX(), 100);
CPPUNIT_ASSERT_DOUBLES_EQUAL(static_cast<long>(7393), aPos.getY(), 100);
+
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf115873()
{
+ comphelper::LibreOfficeKit::setActive();
// Initialize the navigator.
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -2074,10 +2178,12 @@ void SdTiledRenderingTest::testTdf115873()
// This failed, single-click did not result in a shape selection (only
// double-click did).
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rMarkList.GetMarkCount());
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testTdf115873Group()
{
+ comphelper::LibreOfficeKit::setActive();
// Initialize the navigator.
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873-group.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
@@ -2089,11 +2195,13 @@ void SdTiledRenderingTest::testTdf115873Group()
// This failed, Fill() and IsEqualToDoc() were out of sync for group
// shapes.
CPPUNIT_ASSERT(pObjects->IsEqualToDoc(pXImpressDocument->GetDoc()));
+ comphelper::LibreOfficeKit::setActive(false);
}
void SdTiledRenderingTest::testCutSelectionChange()
{
// Load the document.
+ comphelper::LibreOfficeKit::setActive();
SdXImpressDocument* pXImpressDocument = createDoc("cut_selection_change.odp");
CPPUNIT_ASSERT(pXImpressDocument);
@@ -2127,6 +2235,7 @@ void SdTiledRenderingTest::testCutSelectionChange()
// Selection is removed
CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(0), m_aSelection.size());
+ comphelper::LibreOfficeKit::setActive(false);
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);