[Libreoffice-commits] .: Branch 'libreoffice-3-6' - desktop/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 08:52:43 PST 2012


 desktop/source/deployment/manager/dp_extensionmanager.cxx |   30 +++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit c6b955a2316d6943e37406d4a164b97bf85d7b20
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 19 14:14:50 2012 +0100

    fdo#57224: Preserve disabled-state across reinstallDeployedExtensions
    
    (cherry picked from commit 6f9c3bc8edc93be07273d9de13dda19ea6c1da4a plus follow-
    up a05e1e4967a21f3dd5a49215d97df99a7ec84f18 "fdo#57224: Fix logic of considering
    optional/ambiguous value as 'disabled'")
    
    Change-Id: Ic4f6cda4de758df4789e80b48b30f11ef810d2bd
    Reviewed-on: https://gerrit.libreoffice.org/1119
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index b3c21b4..cd09a9e 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -65,6 +65,7 @@
 #include <list>
 #include <boost/unordered_map.hpp>
 #include <algorithm>
+#include <set>
 
 namespace deploy = com::sun::star::deployment;
 namespace lang  = com::sun::star::lang;
@@ -1220,6 +1221,31 @@ void ExtensionManager::reinstallDeployedExtensions(
         Reference<deploy::XPackageManager>
             xPackageManager = getPackageManager(repository);
 
+        std::set< OUString > disabledExts;
+        {
+            const uno::Sequence< Reference<deploy::XPackage> > extensions(
+                xPackageManager->getDeployedPackages(xAbortChannel, xCmdEnv));
+            for ( sal_Int32 pos = 0; pos < extensions.getLength(); ++pos )
+            {
+                try
+                {
+                    beans::Optional< beans::Ambiguous< sal_Bool > > registered(
+                        extensions[pos]->isRegistered(xAbortChannel, xCmdEnv));
+                    if (registered.IsPresent &&
+                        !(registered.Value.IsAmbiguous ||
+                          registered.Value.Value))
+                    {
+                        const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
+                        OSL_ASSERT(!id.isEmpty());
+                        disabledExts.insert(id);
+                    }
+                }
+                catch (const lang::DisposedException &)
+                {
+                }
+            }
+        }
+
         ::osl::MutexGuard guard(getMutex());
         xPackageManager->reinstallDeployedPackages(
             force, xAbortChannel, xCmdEnv);
@@ -1236,7 +1262,9 @@ void ExtensionManager::reinstallDeployedExtensions(
                 const OUString id =  dp_misc::getIdentifier(extensions[ pos ]);
                 const OUString fileName = extensions[ pos ]->getName();
                 OSL_ASSERT(!id.isEmpty());
-                activateExtension(id, fileName, false, true, xAbortChannel, xCmdEnv );
+                activateExtension(
+                    id, fileName, disabledExts.find(id) != disabledExts.end(),
+                    true, xAbortChannel, xCmdEnv );
             }
             catch (const lang::DisposedException &)
             {


More information about the Libreoffice-commits mailing list