summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index 9add42544d8a..194dd875269f 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -693,6 +693,10 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xOldExtension );
{
+ bool added = false;
+ OUString sNewExtensionIdentifier;
+ OUString sNewExtensionFileName;
+
// In this garded section (getMutex) we must not use the argument xCmdEnv
// because it may bring up dialogs (XInteractionHandler::handle) this
//may potententially deadlock. See issue
@@ -737,6 +741,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xNewExtension = xPackageManager->addPackage(
url, properties, OUString(), xAbortChannel,
Reference<ucb::XCommandEnvironment>());
+ added = true;
//If we add a user extension and there is already one which was
//disabled by a user, then the newly installed one is enabled. If we
//add to another repository then the user extension remains
@@ -745,9 +750,8 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
if (repository == "user")
bUserDisabled2 = false;
- // pass the two values via variables to workaround gcc-4.3.4 specific bug (bnc#655912)
- OUString sNewExtensionIdentifier = dp_misc::getIdentifier(xNewExtension);
- OUString sNewExtensionFileName = xNewExtension->getName();
+ sNewExtensionIdentifier = dp_misc::getIdentifier(xNewExtension);
+ sNewExtensionFileName = xNewExtension->getName();
activateExtension(
sNewExtensionIdentifier, sNewExtensionFileName,
@@ -792,6 +796,18 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//If the user aborted installation then a ucb::CommandAbortedException
//is thrown.
//Use a private AbortChannel so the user cannot interrupt.
+ if (added) {
+ try {
+ xPackageManager->removePackage(
+ sNewExtensionIdentifier, sNewExtensionFileName,
+ css::uno::Reference< css::task::XAbortChannel >(),
+ css::uno::Reference< css::ucb::XCommandEnvironment >());
+ } catch (css::uno::Exception & e) {
+ SAL_WARN(
+ "desktop.deployment",
+ "ignoring Exception " << e.Message);
+ }
+ }
try
{
if (xExtensionBackup.is())