summaryrefslogtreecommitdiff
path: root/desktop
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 /desktop
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 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx140
1 files changed, 6 insertions, 134 deletions
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)