summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2019-03-08 12:35:15 +0100
committerAndras Timar <andras.timar@collabora.com>2019-03-08 12:35:15 +0100
commit267627002d54304c4e49b63d21dd906e79ebfa8d (patch)
treecc1a3b81c9b1350a47ba83aa49863f58fa213cf3 /desktop
parent35c4f64a2d17dec439d6e6fc09a4fe25b0341953 (diff)
Revert "LOK: disable LOKit in unit-tests only after destroying all"
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx140
1 files changed, 134 insertions, 6 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index b3f6a7fb943d..3bf935275025 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -65,10 +65,7 @@ public:
virtual void setUp() override
{
- comphelper::LibreOfficeKit::setActive(true);
-
UnoApiTest::setUp();
-
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
SfxApplication::GetOrCreate();
};
@@ -76,10 +73,7 @@ public:
virtual void tearDown() override
{
closeDoc();
-
UnoApiTest::tearDown();
-
- comphelper::LibreOfficeKit::setActive(false);
};
LibLODocument_Impl* loadDoc(const char* pName, LibreOfficeKitDocumentType eType = LOK_DOCTYPE_TEXT);
@@ -319,6 +313,7 @@ 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");
@@ -349,10 +344,12 @@ 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");
@@ -369,10 +366,12 @@ 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));
@@ -394,10 +393,12 @@ 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");
@@ -416,10 +417,12 @@ 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);
@@ -430,10 +433,13 @@ 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);
@@ -461,10 +467,14 @@ 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);
@@ -483,10 +493,14 @@ 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;
@@ -509,26 +523,38 @@ 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");
@@ -544,10 +570,14 @@ 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;
@@ -576,11 +606,15 @@ 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);
@@ -594,6 +628,8 @@ 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()
@@ -627,6 +663,8 @@ 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);
@@ -704,10 +742,14 @@ 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);
@@ -742,10 +784,13 @@ 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;
@@ -761,10 +806,14 @@ 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
@@ -795,10 +844,14 @@ 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);
@@ -834,10 +887,14 @@ 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");
@@ -854,10 +911,14 @@ 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
@@ -884,10 +945,14 @@ 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);
@@ -993,6 +1058,8 @@ void DesktopLOKTest::testSheetSelections()
free(pUsedMimeType);
free(pCopiedContent);
}
+
+ comphelper::LibreOfficeKit::setActive(false);
}
namespace {
@@ -1067,6 +1134,8 @@ 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);
@@ -1171,10 +1240,14 @@ 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);
@@ -1224,10 +1297,14 @@ 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);
@@ -1348,6 +1425,8 @@ 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)
@@ -1358,6 +1437,8 @@ 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));
@@ -1440,10 +1521,14 @@ 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);
@@ -1575,10 +1660,14 @@ 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.
{
@@ -1646,10 +1735,14 @@ 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);
@@ -1673,11 +1766,15 @@ 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));
@@ -1700,6 +1797,8 @@ 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
@@ -1756,6 +1855,8 @@ 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"));
@@ -1795,11 +1896,15 @@ 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"));
@@ -1833,11 +1938,15 @@ 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"),
@@ -1855,11 +1964,14 @@ 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);
@@ -1907,11 +2019,13 @@ 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);
@@ -1957,11 +2071,13 @@ 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);
@@ -2013,10 +2129,12 @@ 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;
@@ -2098,10 +2216,14 @@ 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;
@@ -2111,10 +2233,14 @@ 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);
@@ -2139,6 +2265,8 @@ 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)