summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-04-26 16:06:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-04-26 16:07:11 +0200
commitfdbc6b768c4f16c3f83e95c68f81fc4fcba74af2 (patch)
treea1ab0cbc7479f7498407f95a96b494e831efe8b6 /desktop
parente613da167699c6231e6fa27ce50c422c926855f0 (diff)
Do not accidentally instantiate other exts when removing exts at startup
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx10
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx2
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx3
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h1
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx5
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx4
6 files changed, 14 insertions, 11 deletions
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 2e22863536d4..e5a16b7f6a0c 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -464,7 +464,7 @@ void ExtensionManager::activateExtension(
//Check if this is a disabled user extension,
if (i == 0 && bUserDisabled)
{
- aExt->revokePackage(xAbortChannel, xCmdEnv);
+ aExt->revokePackage(bStartup, xAbortChannel, xCmdEnv);
continue;
}
@@ -473,7 +473,7 @@ void ExtensionManager::activateExtension(
//repositories with a lower priority
if (bActive)
{
- aExt->revokePackage(xAbortChannel, xCmdEnv);
+ aExt->revokePackage(bStartup, xAbortChannel, xCmdEnv);
}
else
{
@@ -694,7 +694,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
try
{
xOldExtension->revokePackage(
- xAbortChannel, Reference<ucb::XCommandEnvironment>());
+ false, xAbortChannel, Reference<ucb::XCommandEnvironment>());
//save the old user extension in case the user aborts
//store the extension in the tmp repository, this will overwrite
//xTmpPackage (same identifier). Do not let the user abort or
@@ -873,7 +873,7 @@ void ExtensionManager::removeExtension(
Reference<deploy::XPackage> xOldExtension =
xPackageManager->getDeployedPackage(
identifier, fileName, xCmdEnv);
- xOldExtension->revokePackage(xAbortChannel, xCmdEnv);
+ xOldExtension->revokePackage(false, xAbortChannel, xCmdEnv);
xPackageManager->removePackage(
identifier, fileName, xAbortChannel, xCmdEnv);
@@ -1024,7 +1024,7 @@ sal_Int32 ExtensionManager::checkPrerequisitesAndEnable(
if (ret)
{
//There are some unfulfilled prerequisites, try to revoke
- extension->revokePackage(xAbortChannel, xCmdEnv);
+ extension->revokePackage(false, xAbortChannel, xCmdEnv);
}
const OUString id(dp_misc::getIdentifier(extension));
activateExtension(id, extension->getName(),
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 3fbe04e5a91b..cda94fb2e6d5 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1322,7 +1322,7 @@ bool PackageManagerImpl::synchronizeRemovedExtensions(
Reference<deployment::XPackage> xPackage = m_xRegistry->bindPackage(
url, i->second.mediaType, true, i->first, xCmdEnv );
OSL_ASSERT(xPackage.is()); //Even if the files are removed, we must get the object.
- xPackage->revokePackage(xAbortChannel, xCmdEnv);
+ xPackage->revokePackage(true, xAbortChannel, xCmdEnv);
removePackage(xPackage->getIdentifier().Value, xPackage->getName(),
xAbortChannel, xCmdEnv);
bModified |= true;
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 7b654d309f8e..16bc5d1445ff 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -726,13 +726,14 @@ void Package::registerPackage(
//______________________________________________________________________________
void Package::revokePackage(
+ sal_Bool startup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException,
CommandFailedException, CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
- processPackage_impl( false /* revoke */, false, xAbortChannel, xCmdEnv );
+ processPackage_impl( false /* revoke */, startup, xAbortChannel, xCmdEnv );
}
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index e8ddb0bd1ff2..9fb0595270b3 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -204,6 +204,7 @@ public:
css::ucb::CommandAbortedException,
css::lang::IllegalArgumentException, css::uno::RuntimeException);
virtual void SAL_CALL revokePackage(
+ sal_Bool startup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
throw (css::deployment::DeploymentException,
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 81b88058b609..c4159242305f 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -909,7 +909,7 @@ void BackendImpl::PackageImpl::processPackage_(
{
try {
bundle[ pos ]->revokePackage(
- xSubAbortChannel, xCmdEnv );
+ startup, xSubAbortChannel, xCmdEnv );
}
catch (const Exception &)
{
@@ -950,7 +950,8 @@ void BackendImpl::PackageImpl::processPackage_(
xPackage->createAbortChannel() );
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
try {
- bundle[ pos ]->revokePackage( xSubAbortChannel, xCmdEnv );
+ bundle[ pos ]->revokePackage(
+ startup, xSubAbortChannel, xCmdEnv );
}
catch (const RuntimeException &) {
throw;
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index 3b6be7c38502..df1923d03d58 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -398,7 +398,7 @@ void BackendImpl::PackageImpl::processPackage_(
bool bDialog = !m_dialogURL.isEmpty();
Reference<css::script::XLibraryContainer3> xDialogLibs;
- bool bRunning = office_is_running();
+ bool bRunning = !startup && office_is_running();
if( bRunning )
{
if( bScript )
@@ -457,7 +457,7 @@ void BackendImpl::PackageImpl::processPackage_(
bDialogSuccess = lcl_maybeAddScript(bDialog, m_dialogName, m_dialogURL, xDialogLibs);
}
bool bSuccess = bScript || bDialog; // Something must have happened
- if( bRunning && !startup)
+ if( bRunning )
if( (bScript && !bScriptSuccess) || (bDialog && !bDialogSuccess) )
bSuccess = false;