summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-11-11 16:54:59 -0500
committerAndras Timar <andras.timar@collabora.com>2019-03-01 17:22:10 +0100
commitccb14cca567dc8bbc17fe0abde01effd08b37d4f (patch)
treef746f4edf3de971613eb5518231ab112813d9cf7 /sd
parentc85840642f11f11a5325c09c044bc16e8acd2833 (diff)
LOK: disable LOKit in unit-tests only after destroying all
When we disable LOKit at the end of a unit-test, we do so before any of the smart-pointers go out of scope. These instances are then destroyed when LOKit is no longer active, in spite of the fact that they were created while it was. This leaves some dialog/window routing notifiers dangling, which cause assertion failures and access-after-free (when they are invoked on destruction inadvertently). The latter issue was found with 'make CppunitTest_sd_tiledrendering VALGRIND=memcheck'. The fix is to move these flags to the setup and teardown stages of cpp-unit. Change-Id: Ic4481305ca1a5cca14d70a4ebbc820a3fdeea9cc Reviewed-on: https://gerrit.libreoffice.org/68256 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx117
1 files changed, 4 insertions, 113 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 1765db27be7d..7e8c0f0b4a0a 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -198,6 +198,8 @@ void SdTiledRenderingTest::setUp()
{
test::BootstrapFixture::setUp();
+ comphelper::LibreOfficeKit::setActive(true);
+
mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
}
@@ -209,6 +211,8 @@ void SdTiledRenderingTest::tearDown()
if (m_pXmlBuffer)
xmlBufferFree(m_pXmlBuffer);
+ comphelper::LibreOfficeKit::setActive(false);
+
test::BootstrapFixture::tearDown();
}
@@ -339,7 +343,6 @@ 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);
@@ -355,12 +358,10 @@ 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();
@@ -385,12 +386,10 @@ 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();
@@ -420,12 +419,10 @@ 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);
@@ -450,12 +447,10 @@ 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);
@@ -476,12 +471,10 @@ 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();
@@ -511,13 +504,10 @@ 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(
@@ -535,12 +525,10 @@ 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);
@@ -561,7 +549,6 @@ 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)
@@ -577,7 +564,6 @@ 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);
@@ -607,12 +593,10 @@ 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);
@@ -628,12 +612,10 @@ 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);
@@ -643,12 +625,10 @@ 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);
@@ -658,12 +638,10 @@ 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);
@@ -675,12 +653,10 @@ 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);
@@ -689,8 +665,6 @@ void SdTiledRenderingTest::testDontSearchInMasterPages()
// the master page)
lcl_search("date");
CPPUNIT_ASSERT_EQUAL(false, m_bFound);
-
- comphelper::LibreOfficeKit::setActive(false);
}
namespace
@@ -713,7 +687,6 @@ 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);
@@ -804,13 +777,10 @@ 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(
@@ -833,13 +803,10 @@ 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();
@@ -850,13 +817,11 @@ 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();
@@ -897,13 +862,11 @@ 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();
@@ -950,7 +913,6 @@ 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.
@@ -1059,8 +1021,6 @@ public:
void SdTiledRenderingTest::testViewCursors()
{
- comphelper::LibreOfficeKit::setActive();
-
// Create two views.
SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
ViewCallback aView1;
@@ -1083,14 +1043,10 @@ 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;
@@ -1125,13 +1081,10 @@ 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;
@@ -1175,13 +1128,10 @@ 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;
@@ -1206,13 +1156,10 @@ 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();
@@ -1250,13 +1197,10 @@ 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;
@@ -1290,13 +1234,10 @@ 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;
@@ -1347,13 +1288,11 @@ 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();
@@ -1389,14 +1328,11 @@ 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;
@@ -1436,7 +1372,6 @@ void SdTiledRenderingTest::testPostKeyEventInvalidation()
mxComponent->dispose();
mxComponent.clear();
- comphelper::LibreOfficeKit::setActive(false);
}
/**
@@ -1445,7 +1380,6 @@ 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();
@@ -1503,8 +1437,6 @@ void SdTiledRenderingTest::testTdf103083()
const SfxItemSet& rParagraphItemSet2 = pTextObject->GetOutlinerParaObject()->GetTextObject().GetParaAttribs(2);
CPPUNIT_ASSERT_EQUAL((sal_uInt16)3, rParagraphItemSet2.Count());
-
- comphelper::LibreOfficeKit::setActive(false);
}
/**
@@ -1513,7 +1445,6 @@ 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();
@@ -1561,13 +1492,10 @@ 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();
@@ -1597,13 +1525,11 @@ 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();
@@ -1654,13 +1580,11 @@ 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);
@@ -1770,13 +1694,11 @@ 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();
@@ -1817,14 +1739,11 @@ 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();
@@ -1874,14 +1793,10 @@ 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);
@@ -1923,14 +1838,11 @@ 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();
@@ -1943,15 +1855,11 @@ 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();
{
@@ -1966,14 +1874,11 @@ 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();
@@ -2006,14 +1911,11 @@ 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();
@@ -2075,14 +1977,11 @@ 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);
@@ -2140,13 +2039,10 @@ 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();
@@ -2178,12 +2074,10 @@ 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();
@@ -2195,13 +2089,11 @@ 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);
@@ -2235,7 +2127,6 @@ 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);