[PATCH libreoffice-3-6] Cleanly remove an extension again that cannot be activated w...

Stephan Bergmann (via Code Review) gerrit at gerrit.libreoffice.org
Tue Feb 5 04:22:12 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1995

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/95/1995/1

Cleanly remove an extension again that cannot be activated while installing it

...otherwise, it will needlessly be carried forward marked "broken."

Change-Id: I12fbd4430e1ecc11f1969ae5f49aed43668f2c27
(cherry picked from commit 3c71fa1e5ee6cd83f713c65a372006bc3aef0953)
---
M desktop/source/deployment/manager/dp_extensionmanager.cxx
1 file changed, 19 insertions(+), 3 deletions(-)



diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index cd09a9e..b9b255f 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -677,6 +677,10 @@
         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
@@ -733,6 +737,7 @@
                     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
@@ -741,9 +746,8 @@
                     if (repository.equals(OUSTR("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,
@@ -788,6 +792,18 @@
             //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())

-- 
To view, visit https://gerrit.libreoffice.org/1995
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12fbd4430e1ecc11f1969ae5f49aed43668f2c27
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Stephan Bergmann <sbergman at redhat.com>


More information about the LibreOffice mailing list