Use comphelper::LibreOfficeKit::isActive() instead of LOK_TEST env var

Change-Id: Iaa0c751f101df6db25e9fca9123b81ac63033159
This commit is contained in:
Tor Lillqvist
2015-04-09 20:28:18 +03:00
parent 2dede8bfba
commit 72e7bf859d
3 changed files with 4 additions and 7 deletions

View File

@@ -33,6 +33,7 @@
#include <unotools/configmgr.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/bootstrap.hxx>
@@ -421,8 +422,7 @@ void Desktop::SynchronizeExtensionRepositories()
deployment::ExtensionManager::get(context)->reinstallDeployedExtensions(
true, "user", Reference<task::XAbortChannel>(), silent);
#if !HAVE_FEATURE_MACOSX_SANDBOX
// getenv is a hack to detect if we're running in a LOK unit test
if (!getenv("LOK_TEST"))
if (!comphelper::LibreOfficeKit::isActive())
task::OfficeRestartManager::get(context)->requestRestart(
silent->getInteractionHandler());
#endif

View File

@@ -42,6 +42,7 @@
#include <com/sun/star/task/OfficeRestartManager.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <salhelper/linkhelper.hxx>
@@ -558,8 +559,7 @@ void syncRepositories(
}
}
#if !HAVE_FEATURE_MACOSX_SANDBOX
// getenv is a hack to detect if we're running in a LOK unit test
if (bModified && !getenv("LOK_TEST"))
if (bModified && !comphelper::LibreOfficeKit::isActive())
{
Reference<task::XRestartManager> restarter(task::OfficeRestartManager::get(comphelper::getProcessComponentContext()));
if (restarter.is())

View File

@@ -84,9 +84,6 @@ void TiledRenderingTest::runAllTests()
OUString sUserInstallURL = aWorkdirRootURL + "/unittest";
rtl::Bootstrap::set(OUString("UserInstallation"), sUserInstallURL);
// No restart in desktop.
setenv("LOK_TEST", "1", true);
scoped_ptr< Office > pOffice( lok_cpp_init(
m_sLOPath.c_str() ) );
CPPUNIT_ASSERT( pOffice.get() );