[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - desktop/qa sd/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Mar 1 16:22:37 UTC 2019


 desktop/qa/desktop_lib/test_desktop_lib.cxx  |  140 +--------------------------
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  117 ----------------------
 2 files changed, 10 insertions(+), 247 deletions(-)

New commits:
commit ccb14cca567dc8bbc17fe0abde01effd08b37d4f
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Nov 11 16:54:59 2018 -0500
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Mar 1 17:22:10 2019 +0100

    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 at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index bd5119358aa2..195cbbfd50d6 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -65,7 +65,10 @@ public:
 
     virtual void setUp() override
     {
+        comphelper::LibreOfficeKit::setActive(true);
+
         UnoApiTest::setUp();
+
         mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
         SfxApplication::GetOrCreate();
     };
@@ -73,7 +76,10 @@ public:
     virtual void tearDown() override
     {
         closeDoc();
+
         UnoApiTest::tearDown();
+
+        comphelper::LibreOfficeKit::setActive(false);
     };
 
     LibLODocument_Impl* loadDoc(const char* pName, LibreOfficeKitDocumentType eType = LOK_DOCTYPE_TEXT);
@@ -313,7 +319,6 @@ void DesktopLOKTest::callbackImpl(int nType, const char* pPayload)
 
 void DesktopLOKTest::testGetStyles()
 {
-    comphelper::LibreOfficeKit::setActive();
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     boost::property_tree::ptree aTree;
     char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:StyleApply");
@@ -344,12 +349,10 @@ void DesktopLOKTest::testGetStyles()
             CPPUNIT_FAIL("Unknown style family: " + rPair.first);
         }
     }
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testGetFonts()
 {
-    comphelper::LibreOfficeKit::setActive();
     LibLODocument_Impl* pDocument = loadDoc("blank_presentation.odp");
     boost::property_tree::ptree aTree;
     char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CharFontName");
@@ -366,12 +369,10 @@ void DesktopLOKTest::testGetFonts()
         CPPUNIT_ASSERT( rPair.second.size() > 0);
     }
     free(pJSON);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testCreateView()
 {
-    comphelper::LibreOfficeKit::setActive();
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViewsCount(pDocument));
 
@@ -393,12 +394,10 @@ void DesktopLOKTest::testCreateView()
 
     pDocument->m_pDocumentClass->destroyView(pDocument, nId1);
     CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViewsCount(pDocument));
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testGetPartPageRectangles()
 {
-    comphelper::LibreOfficeKit::setActive();
     // Test that we get as many page rectangles as expected: blank document is
     // one page.
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
@@ -417,12 +416,10 @@ void DesktopLOKTest::testGetPartPageRectangles()
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aRectangles.size());
 
     free(pRectangles);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testGetFilterTypes()
 {
-    comphelper::LibreOfficeKit::setActive();
     LibLibreOffice_Impl aOffice;
     char* pJSON = aOffice.m_pOfficeClass->getFilterTypes(&aOffice);
 
@@ -433,13 +430,10 @@ void DesktopLOKTest::testGetFilterTypes()
     CPPUNIT_ASSERT(aTree.size() > 0);
     CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>());
     free(pJSON);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSearchCalc()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLibreOffice_Impl aOffice;
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -467,14 +461,10 @@ void DesktopLOKTest::testSearchCalc()
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m_aSearchResultSelection.size());
     // Result is on the first sheet.
     CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSearchAllNotificationsCalc()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLibreOffice_Impl aOffice;
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -493,14 +483,10 @@ void DesktopLOKTest::testSearchAllNotificationsCalc()
     CPPUNIT_ASSERT_EQUAL(0, m_nSelectionBeforeSearchResult);
     // But we do get the selection afterwards.
     CPPUNIT_ASSERT(m_nSelectionAfterSearchResult > 0);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testPaintTile()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     int nCanvasWidth = 100;
     int nCanvasHeight = 300;
@@ -523,38 +509,26 @@ void DesktopLOKTest::testPaintTile()
     nTileHeight = 4000;
     aBuffer.resize(nCanvasWidth * nCanvasHeight * 4);
     pDocument->pClass->paintTile(pDocument, aBuffer.data(), nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSaveAs()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     utl::TempFile aTempFile;
     aTempFile.EnableKillingFile();
     CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSaveAsCalc()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
     utl::TempFile aTempFile;
     aTempFile.EnableKillingFile();
     CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testPasteWriter()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     OString aText("hello");
 
@@ -570,14 +544,10 @@ void DesktopLOKTest::testPasteWriter()
     CPPUNIT_ASSERT(!pDocument->pClass->paste(pDocument, "textt/plain;charset=utf-8", aText.getStr(), aText.getLength()));
     // Writer is expected to support text/html.
     CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/html", aText.getStr(), aText.getLength()));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testPasteWriterJPEG()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
 
     OUString aFileURL;
@@ -606,15 +576,11 @@ void DesktopLOKTest::testPasteWriterJPEG()
     xShape.set(xDrawPage->getByIndex(0), uno::UNO_QUERY);
     // This was text::TextContentAnchorType_AS_CHARACTER, AnchorType argument was ignored.
     CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testUndoWriter()
 {
     // Load a Writer document and press a key.
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
     pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYUP, 't', 0);
@@ -628,8 +594,6 @@ void DesktopLOKTest::testUndoWriter()
     boost::property_tree::read_json(aStream, aTree);
     // Make sure that pressing a key creates exactly one undo action.
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("actions").size());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testRowColumnHeaders()
@@ -663,8 +627,6 @@ void DesktopLOKTest::testRowColumnHeaders()
      * "size" defines the bottom/right boundary of a row/column in twips (size between 0 and boundary)
      * "text" has the header label in UTF-8
      */
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
 
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -742,14 +704,10 @@ void DesktopLOKTest::testRowColumnHeaders()
         nPrevious = nSize;
     }
     CPPUNIT_ASSERT(!bNotEnoughHeaders);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testHiddenRowHeaders()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("hidden-row.ods");
 
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
@@ -784,13 +742,10 @@ void DesktopLOKTest::testHiddenRowHeaders()
         }
         nPrevious = nSize;
     }
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testCellCursor()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
 
     boost::property_tree::ptree aTree;
@@ -806,14 +761,10 @@ void DesktopLOKTest::testCellCursor()
     OString aRectangle(aTree.get<std::string>("commandValues").c_str());
     // cell cursor geometry + col + row
     CPPUNIT_ASSERT_EQUAL(OString("0, 0, 1274, 254, 0, 0"), aRectangle);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testCommandResult()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
 
     // the postUnoCommand() is supposed to be async, let's test it safely
@@ -844,14 +795,10 @@ void DesktopLOKTest::testCommandResult()
 
     CPPUNIT_ASSERT_EQUAL(aTree.get_child("commandName").get_value<std::string>(), std::string(".uno:Bold"));
     CPPUNIT_ASSERT_EQUAL(aTree.get_child("success").get_value<bool>(), true);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testWriterComments()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
     uno::Reference<awt::XReschedule> xToolkit(com::sun::star::awt::Toolkit::create(comphelper::getProcessComponentContext()), uno::UNO_QUERY);
@@ -887,14 +834,10 @@ void DesktopLOKTest::testWriterComments()
     auto xTextField = xTextPortion->getPropertyValue("TextField").get< uno::Reference<beans::XPropertySet> >();
     // This was empty, typed characters ended up in the body text.
     CPPUNIT_ASSERT_EQUAL(OUString("test"), xTextField->getPropertyValue("Content").get<OUString>());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testTrackChanges()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     // Load a document and create two views.
     LibLibreOffice_Impl aOffice;
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
@@ -911,14 +854,10 @@ void DesktopLOKTest::testTrackChanges()
     Scheduler::ProcessEventsToIdle();
     // This was 1, only the active view was notified.
     CPPUNIT_ASSERT_EQUAL(2, m_nTrackChanges);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSheetOperations()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("sheets.ods");
 
     // insert the last sheet
@@ -945,14 +884,10 @@ void DesktopLOKTest::testSheetOperations()
     {
         CPPUNIT_ASSERT_EQUAL(aExpected[i], OString(pDocument->pClass->getPartName(pDocument, i)));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testSheetSelections()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("sheets.ods", LOK_DOCTYPE_SPREADSHEET);
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1058,8 +993,6 @@ void DesktopLOKTest::testSheetSelections()
         free(pUsedMimeType);
         free(pCopiedContent);
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 namespace {
@@ -1134,8 +1067,6 @@ namespace {
 
 void DesktopLOKTest::testContextMenuCalc()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("sheet_with_image.ods", LOK_DOCTYPE_SPREADSHEET);
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1240,14 +1171,10 @@ void DesktopLOKTest::testContextMenuCalc()
         CPPUNIT_ASSERT(aCheckedToCell);
         CPPUNIT_ASSERT_EQUAL(std::string(aCheckedToCell.get().data()), std::string("false"));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testContextMenuWriter()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1297,14 +1224,10 @@ void DesktopLOKTest::testContextMenuWriter()
         CPPUNIT_ASSERT(aEnabled);
         CPPUNIT_ASSERT_EQUAL(std::string(aEnabled.get().data()), std::string("true"));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testContextMenuImpress()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_presentation.odp", LOK_DOCTYPE_PRESENTATION);
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
@@ -1425,8 +1348,6 @@ void DesktopLOKTest::testContextMenuImpress()
         CPPUNIT_ASSERT(aCheckedHelpFront);
         CPPUNIT_ASSERT_EQUAL(std::string(aCheckedHelpFront.get().data()), std::string("true"));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 static void callbackCompressionTest(const int type, const char* payload, void* data)
@@ -1437,8 +1358,6 @@ static void callbackCompressionTest(const int type, const char* payload, void* d
 
 void DesktopLOKTest::testNotificationCompression()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     std::vector<std::tuple<int, std::string>> notifs;
     std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
@@ -1521,14 +1440,10 @@ void DesktopLOKTest::testNotificationCompression()
 
     CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_STATE_CHANGED, std::get<0>(notifs[i]));
     CPPUNIT_ASSERT_EQUAL(std::string(".uno:AssignLayout=1"), std::get<1>(notifs[i++]));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testTileInvalidationCompression()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
 
     comphelper::LibreOfficeKit::setPartInInvalidation(true);
@@ -1660,14 +1575,10 @@ void DesktopLOKTest::testTileInvalidationCompression()
         CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_TILES, std::get<0>(notifs[i]));
         CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 1000000000, 1000000000, 0"), std::get<1>(notifs[i++]));
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testPartInInvalidation()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     // No part in invalidation: merge.
     {
@@ -1735,14 +1646,10 @@ void DesktopLOKTest::testPartInInvalidation()
         // payload, so this was merged -> it was 1.
         CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), notifs.size());
     }
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testRedlineWriter()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     // Load a Writer document, enable change recording and press a key.
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY);
@@ -1766,15 +1673,11 @@ void DesktopLOKTest::testRedlineWriter()
         CPPUNIT_ASSERT_EQUAL(std::string("Insert \xE2\x80\x9Ct\xE2\x80\x9D"), rRedline.second.get<std::string>("description"));
             // U+201C LEFT DOUBLE QUOTATION MARK, U+201D RIGHT DOUBLE QUOTATION
             // MARK
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testRedlineCalc()
 {
     // Load a Writer document, enable change recording and press a key.
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("sheets.ods");
     uno::Reference<beans::XPropertySet> xPropertySet(mxComponent, uno::UNO_QUERY);
     xPropertySet->setPropertyValue("RecordChanges", uno::makeAny(true));
@@ -1797,8 +1700,6 @@ void DesktopLOKTest::testRedlineCalc()
     for (boost::property_tree::ptree::value_type& rRedline : aTree.get_child("redlines"))
         // This failed with boost::property_tree::ptree_bad_path, as there were no description field.
         CPPUNIT_ASSERT_EQUAL(std::string("Cell B4 changed from '5' to 't'"), rRedline.second.get<std::string>("description"));
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 class ViewCallback
@@ -1855,8 +1756,6 @@ public:
 void DesktopLOKTest::testPaintPartTile()
 {
     // Load an impress doc of 2 slides.
-    comphelper::LibreOfficeKit::setActive();
-
     ViewCallback aView1;
     ViewCallback aView2;
     std::unique_ptr<LibLODocument_Impl> xDocument(loadDoc("2slides.odp"));
@@ -1896,15 +1795,11 @@ void DesktopLOKTest::testPaintPartTile()
     //CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
 
     mxComponent.clear();
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testWriterCommentInsertCursor()
 {
     // Load a document and type a character into the body text of the second view.
-    comphelper::LibreOfficeKit::setActive();
-
     ViewCallback aView1;
     ViewCallback aView2;
     std::unique_ptr<LibLODocument_Impl> xDocument(loadDoc("blank_text.odt"));
@@ -1938,15 +1833,11 @@ void DesktopLOKTest::testWriterCommentInsertCursor()
 
     Scheduler::ProcessEventsToIdle();
     mxComponent.clear();
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 #if HAVE_MORE_FONTS
 void DesktopLOKTest::testGetFontSubset()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     OUString aFontName = rtl::Uri::encode(
         OUString("Liberation Sans"),
@@ -1964,14 +1855,11 @@ void DesktopLOKTest::testGetFontSubset()
     boost::property_tree::ptree aValues = aTree.get_child("commandValues");
     CPPUNIT_ASSERT( aValues.size() > 0 );
     free(pJSON);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 #endif
 
 void DesktopLOKTest::testCommentsWriter()
 {
-    comphelper::LibreOfficeKit::setActive();
     // Disable tiled rendering for comments
     comphelper::LibreOfficeKit::setTiledAnnotations(false);
 
@@ -2019,13 +1907,11 @@ void DesktopLOKTest::testCommentsWriter()
     }
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 
 void DesktopLOKTest::testCommentsCalc()
 {
-    comphelper::LibreOfficeKit::setActive();
     // Disable tiled rendering for comments
     comphelper::LibreOfficeKit::setTiledAnnotations(false);
 
@@ -2071,13 +1957,11 @@ void DesktopLOKTest::testCommentsCalc()
     CPPUNIT_ASSERT_EQUAL(2, nIdx);
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 
 void DesktopLOKTest::testCommentsImpress()
 {
-    comphelper::LibreOfficeKit::setActive();
     // Disable tiled rendering for comments
     comphelper::LibreOfficeKit::setTiledAnnotations(false);
 
@@ -2129,12 +2013,10 @@ void DesktopLOKTest::testCommentsImpress()
     CPPUNIT_ASSERT_EQUAL(2, nIdx);
 
     comphelper::LibreOfficeKit::setTiledAnnotations(true);
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testCommentsCallbacksWriter()
 {
-    comphelper::LibreOfficeKit::setActive();
     // Comments callback are emitted only if tiled annotations are off
     comphelper::LibreOfficeKit::setTiledAnnotations(false);
     ViewCallback aView1;
@@ -2216,14 +2098,10 @@ void DesktopLOKTest::testCommentsCallbacksWriter()
     CPPUNIT_ASSERT(!aStream.str().empty());
     boost::property_tree::read_json(aStream, aTree);
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(5), aTree.get_child("comments").size());
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testRunMacro()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     LibLibreOffice_Impl aOffice;
     bool bGoodMacro, bNonExistentMacro;
 
@@ -2233,14 +2111,10 @@ void DesktopLOKTest::testRunMacro()
 
     bNonExistentMacro = aOffice.m_pOfficeClass->runMacro(&aOffice, OString("macro:///I.Am.Not(There)").getStr());
     CPPUNIT_ASSERT(!bNonExistentMacro);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::testExtractParameter()
 {
-    comphelper::LibreOfficeKit::setActive();
-
     OUString aOptions("Language=de-DE");
     OUString aValue = extractParameter(aOptions, "Language");
     CPPUNIT_ASSERT_EQUAL(OUString("de-DE"), aValue);
@@ -2265,8 +2139,6 @@ void DesktopLOKTest::testExtractParameter()
     aValue = extractParameter(aOptions, "Language");
     CPPUNIT_ASSERT_EQUAL(OUString(), aValue);
     CPPUNIT_ASSERT_EQUAL(OUString("Something1,Something2=blah,Something3"), aOptions);
-
-    comphelper::LibreOfficeKit::setActive(false);
 }
 
 void DesktopLOKTest::readFileIntoByteVector(OUString const & sFilename, std::vector<unsigned char> & rByteVector)
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);


More information about the Libreoffice-commits mailing list