summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario J. Rugiero <mrugiero@gmail.com>2015-10-29 01:06:38 -0300
committerMichael Stahl <mstahl@redhat.com>2015-10-29 23:03:31 +0000
commitefbde08e2a9930edb4637824d9d3a768873314a8 (patch)
tree7c97f7699208e9c62367e23215c983d23612abc6
parent3c2c5ef575eec07617cd759985f4ab5fb8732eff (diff)
Cleanup in sfx2 tree
Replaced a few std::for_each occurences by range based for loops, and the only boost::bind in such tree by a lambda, alongside with a bind2nd call and boost/bind.hxx headers cleanup. Change-Id: Ie5e58f5b7d23ec846fd7457a6bad0132e0278dbf Reviewed-on: https://gerrit.libreoffice.org/19662 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx1
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx20
-rw-r--r--sfx2/source/doc/Metadatable.cxx12
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx2
-rw-r--r--sfx2/source/sidebar/Panel.cxx2
6 files changed, 15 insertions, 26 deletions
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 8d93542af4ee..a1876f804919 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -40,7 +40,6 @@
#include <basic/sbxmeth.hxx>
#include <basic/sbxobj.hxx>
#include <basic/sbxvar.hxx>
-#include <boost/bind.hpp>
#include <boost/logic/tribool.hpp>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 580de689ce55..5679c3596adb 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -1197,8 +1197,8 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
{
// global filter arry was modified, factory specific ones might need an
// update too
- std::for_each(aImplArr.begin(), aImplArr.end(),
- std::mem_fun_ref(&SfxFilterMatcher_Impl::Update));
+ for (auto& aImpl : aImplArr)
+ aImpl.Update();
}
}
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 1122f8084329..385cf2afcdfe 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -48,14 +48,9 @@
#include <libxml/tree.h>
-#include <boost/bind.hpp>
-#include <boost/tuple/tuple.hpp>
-
#include <vector>
#include <set>
#include <map>
-#include <functional>
-#include <algorithm>
#include <unotools/ucbhelper.hxx>
#include <com/sun/star/uri/XUriReference.hpp>
@@ -890,9 +885,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, std::exception)
getAllParts(*m_pImpl) );
::std::remove_copy_if(parts.begin(), parts.end(),
::std::back_inserter(ret),
- ::boost::bind(
- ::std::logical_not<bool>(),
- ::boost::bind(&isPartOfType, ::boost::ref(*m_pImpl), _1, i_xType) ));
+ [this, &i_xType](uno::Reference< rdf::XURI > aPart) {
+ return !isPartOfType(*m_pImpl, aPart, i_xType);
+ } );
return ::comphelper::containerToSequence(ret);
}
@@ -1162,12 +1157,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"exception", *this, uno::makeAny(e));
}
- std::for_each(StgFiles.begin(), StgFiles.end(),
- boost::bind(addContentOrStylesFileImpl, boost::ref(*m_pImpl), _1));
+ for (const auto& aStgFile : StgFiles)
+ addContentOrStylesFileImpl(*m_pImpl, aStgFile);
- std::for_each(MfstMetadataFiles.begin(), MfstMetadataFiles.end(),
- boost::bind(importFile, boost::ref(*m_pImpl),
- i_xStorage, baseURI, i_xHandler, _1));
+ for (const auto& aMfstMetadataFile : MfstMetadataFiles)
+ importFile(*m_pImpl, i_xStorage, baseURI, i_xHandler, aMfstMetadataFile);
}
void SAL_CALL DocumentMetadataAccess::storeMetadataToStorage(
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index b5929b4d258c..77cf9533aa39 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -640,13 +640,11 @@ removeLink(Metadatable* i_pObject)
XmlIdRegistryDocument::~XmlIdRegistryDocument()
{
// notify all list elements that are actually in the clipboard
- for (XmlIdMap_t::iterator iter(m_pImpl->m_XmlIdMap.begin());
- iter != m_pImpl->m_XmlIdMap.end(); ++iter)
- {
- ::std::for_each(iter->second.first.begin(), iter->second.first.end(),
- removeLink);
- ::std::for_each(iter->second.second.begin(), iter->second.second.end(),
- removeLink);
+ for (auto& aXmlId : m_pImpl->m_XmlIdMap) {
+ for (auto aLink : aXmlId.second.first)
+ removeLink(aLink);
+ for (auto aLink : aXmlId.second.second)
+ removeLink(aLink);
}
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1d0717aefb98..82e919e52b34 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -577,7 +577,7 @@ namespace
io_rTypes.getConstArray(),
io_rTypes.getConstArray() + io_rTypes.getLength(),
aStrippedTypes.getArray(),
- ::std::bind2nd( ::std::equal_to< uno::Type >(), i_rTypeToStrip )
+ [&i_rTypeToStrip](const uno::Type& aType) { return aType == i_rTypeToStrip; }
);
io_rTypes = aStrippedTypes;
}
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index e67d9d901ebf..42a2a813d359 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -39,8 +39,6 @@
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/ui/XToolPanel.hpp>
-#include <boost/bind.hpp>
-
using namespace css;
using namespace css::uno;