summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-05-18 14:10:21 +0900
committerDavid Tardon <dtardon@redhat.com>2015-05-26 10:39:20 +0200
commitb4848def4684ad277af23a10d73b4b5c9cb201fb (patch)
tree70abe9d2aa1df32ebad2c25a9ac0073855af4e55
parent6a4a55d5f48e52dd4a5094028d729ac4cc9d766e (diff)
desktop: simplify code by std::none_of
Change-Id: Ie69927f3a1e0a8049ea7e15f949e17d5b9f15fce
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx6
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx7
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx4
3 files changed, 9 insertions, 8 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 3989e2d8ae3a..a36be548709a 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 3ddc5f83f757..291206e2f38f 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 358247908307..51778a9f80db 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 ) );