[Libreoffice-commits] core.git: desktop/source

Takeshi Abe tabe at fixedpoint.jp
Tue May 26 01:40:46 PDT 2015


 desktop/source/deployment/gui/dp_gui_extlistbox.cxx       |    6 +++---
 desktop/source/deployment/manager/dp_manager.cxx          |    7 +++----
 desktop/source/deployment/registry/package/dp_package.cxx |    4 +++-
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit b4848def4684ad277af23a10d73b4b5c9cb201fb
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon May 18 14:10:21 2015 +0900

    desktop: simplify code by std::none_of
    
    Change-Id: Ie69927f3a1e0a8049ea7e15f949e17d5b9f15fce

diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 3989e2d..a36be54 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -32,6 +32,7 @@
 #include <cppuhelper/weakref.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
+#include <algorithm>
 
 #define USER_PACKAGE_MANAGER    "user"
 #define SHARED_PACKAGE_MANAGER  "shared"
@@ -982,9 +983,8 @@ void ExtensionBox_Impl::addEventListenerOnce(
 {
     //make sure to only add the listener once
     cleanVecListenerAdded();
-    if ( ::std::find_if(m_vListenerAdded.begin(), m_vListenerAdded.end(),
-                        FindWeakRef(extension))
-         == m_vListenerAdded.end())
+    if ( ::std::none_of(m_vListenerAdded.begin(), m_vListenerAdded.end(),
+                        FindWeakRef(extension)) )
     {
         extension->addEventListener( uno::Reference< lang::XEventListener > (
                                          m_xRemoveListener, uno::UNO_QUERY ) );
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 3ddc5f8..291206e 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -62,6 +62,7 @@
 #include "dp_descriptioninfoset.hxx"
 #include "dp_commandenvironments.hxx"
 #include "dp_properties.hxx"
+#include <algorithm>
 
 using namespace ::dp_misc;
 using namespace ::com::sun::star;
@@ -214,8 +215,7 @@ void PackageManagerImpl::initActivationLayer(
             {
                 OUString const & tempEntry = tempEntries[ pos ];
                 const MatchTempDir match( tempEntry );
-                if (::std::find_if( id2temp.begin(), id2temp.end(), match ) ==
-                    id2temp.end())
+                if (::std::none_of( id2temp.begin(), id2temp.end(), match ))
                 {
                     const OUString url(
                         makeURL(m_activePackages_expanded, tempEntry ) );
@@ -1336,8 +1336,7 @@ bool PackageManagerImpl::synchronizeAddedExtensions(
             //installed the extension it was already checked if there is one with the
             //same identifier.
             const MatchTempDir match(titleEncoded);
-            if (::std::find_if( id2temp.begin(), id2temp.end(), match ) ==
-                id2temp.end())
+            if (::std::none_of( id2temp.begin(), id2temp.end(), match ))
             {
 
                 // The folder was not found in the data base, so it must be
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 3582479..51778a9 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -65,6 +65,8 @@
 #include <com/sun/star/xml/xpath/XXPathAPI.hpp>
 #include <com/sun/star/deployment/XPackageManager.hpp>
 #include <boost/optional.hpp>
+
+#include <algorithm>
 #include <vector>
 
 #include "dp_extbackenddb.hxx"
@@ -1524,7 +1526,7 @@ void BackendImpl::PackageImpl::scanBundle(
         //We make sure that we only create one XPackage for a particular URL.
         //Sometime programmers insert the same URL several times in the manifest
         //which may lead to DisposedExceptions.
-        if (bundle.end() == std::find_if(bundle.begin(), bundle.end(), XPackage_eq(url)))
+        if (std::none_of(bundle.begin(), bundle.end(), XPackage_eq(url)))
         {
             const Reference<deployment::XPackage> xPackage(
                 bindBundleItem( url, mediaType, false, OUString(), xCmdEnv ) );


More information about the Libreoffice-commits mailing list