[Libreoffice-commits] .: 2 commits - desktop/source

David Tardon dtardon at kemper.freedesktop.org
Tue Nov 16 03:20:17 PST 2010


 desktop/source/deployment/misc/dp_update.cxx |   23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

New commits:
commit 1b9afa66eae5b6ff3915c5e63a245eef1344793e
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Nov 16 10:16:41 2010 +0100

    simplify a bit

diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index 66a3920..fea8ee7 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -203,17 +203,12 @@ bool onlyBundledExtensions(
     if (extensionList)
     {
         typedef std::vector<Reference<deployment::XPackage > >::const_iterator CIT;
-        for (CIT i = extensionList->begin(); i != extensionList->end(); i++)
+        for (CIT i(extensionList->begin()), aEnd(extensionList->end()); onlyBundled && i != aEnd; ++i)
         {
             Sequence<Reference<deployment::XPackage> > seqExt = xExtMgr->getExtensionsWithSameIdentifier(
                 dp_misc::getIdentifier(*i), (*i)->getName(), Reference<ucb::XCommandEnvironment>());
 
-            if (!containsBundledOnly(seqExt))
-            {
-                onlyBundled = false;
-                break;
-            }
-            
+            onlyBundled = containsBundledOnly(seqExt);
         }
     }
     else
@@ -221,13 +216,9 @@ bool onlyBundledExtensions(
         const uno::Sequence< uno::Sequence< Reference<deployment::XPackage > > > seqAllExt =
             xExtMgr->getAllExtensions(Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>());
         
-        for (int pos = seqAllExt.getLength(); pos --; )
+        for (int pos(0), nLen(seqAllExt.getLength()); onlyBundled && pos != nLen; ++pos)
         {
-            if (!containsBundledOnly(seqAllExt[pos]))
-            {
-                onlyBundled = false;
-                break;
-            }
+            onlyBundled = containsBundledOnly(seqAllExt[pos]);
         }
     }
     return onlyBundled;
commit 81c6986fd90f2c96a508487622fd0b16ed586b8a
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Nov 16 09:49:07 2010 +0100

    simplify bool expression

diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index 531409f..66a3920 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -187,11 +187,9 @@ void getDefaultUpdateInfos(
 bool containsBundledOnly(Sequence<Reference<deployment::XPackage> > const & sameIdExtensions)
 {
     OSL_ASSERT(sameIdExtensions.getLength() == 3);
-    if (!sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is())
-        return true;
-    else
-        return false;
+    return !sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is();
 }
+
 /** Returns true if the list of extensions are bundled extensions and there are no
     other extensions with the same identifier in the shared or user repository.
     If extensionList is NULL, then it is checked if there are only bundled extensions.


More information about the Libreoffice-commits mailing list