This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch compilers-101 in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit e91b67eef96d7bc533eec0270f6890d8ebe75519 Author: Pedro F. Giffuni <[email protected]> AuthorDate: Thu Nov 5 23:59:35 2026 -0500 Boost modernization Phase 3 continued: boost::bind to C++14 lambdas (~30 more files) - Replace boost::bind with C++14 lambdas in: - sal/osl/all/debugbase.cxx (isSubStr predicate) - oox/source/ppt/timenode.cxx (TimeNode::addNode for_each) - oox/source/drawingml/diagram/diagram.cxx (dump for_each) - oox/source/drawingml/diagram/diagramlayoutatoms.cxx (dump/processAtom/_test_atom) - basegfx/test/boxclipper.cxx (nested bind: appendElement + getB2DRange, compare + getB2DPoint) - svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx (ScopeGuard resetFlag) - svx/source/unodraw/unoshape.cxx (ScopeGuard endSetPropertyValues) - svx/source/gallery2/galbrws.cxx (KeyInput, ThemeSelectionHasChanged, InitSettings callbacks) - Remove #include <boost/bind.hpp> where no longer needed --- main/basegfx/test/boxclipper.cxx | 19 ++----------------- .../source/deployment/manager/dp_extensionmanager.cxx | 5 ++--- main/desktop/source/deployment/manager/dp_manager.cxx | 5 ++--- main/oox/source/drawingml/diagram/diagram.cxx | 5 ++--- .../source/drawingml/diagram/diagramlayoutatoms.cxx | 7 +++---- main/oox/source/ppt/timenode.cxx | 4 +--- main/sal/osl/all/debugbase.cxx | 3 +-- main/svx/source/gallery2/galbrws.cxx | 7 +++---- .../sdr/contact/viewobjectcontactofunocontrol.cxx | 3 +-- main/svx/source/unodraw/unoshape.cxx | 3 +-- 10 files changed, 18 insertions(+), 43 deletions(-) diff --git a/main/basegfx/test/boxclipper.cxx b/main/basegfx/test/boxclipper.cxx index 41c85a1ced..99c16585d4 100644 --- a/main/basegfx/test/boxclipper.cxx +++ b/main/basegfx/test/boxclipper.cxx @@ -42,7 +42,6 @@ #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/numeric/ftools.hxx> -#include <boost/bind.hpp> using namespace ::basegfx; @@ -178,14 +177,7 @@ public: rtl::OUString::createFromAscii(randomSvg), false, 0); std::for_each(randomPoly.begin(), randomPoly.end(), - boost::bind( - &B2DPolyRange::appendElement, - boost::ref(aRandomIntersections), - boost::bind( - &B2DPolygon::getB2DRange, - _1), - ORIENTATION_NEGATIVE, - 1)); + [&](const auto& poly) { aRandomIntersections.appendElement( poly.getB2DRange(), ORIENTATION_NEGATIVE, 1 ); }); #endif } @@ -226,14 +218,7 @@ public: // now, sort all polygons with increasing 0th point std::sort(aRes.begin(), aRes.end(), - boost::bind( - &compare, - boost::bind( - &B2DPolygon::getB2DPoint, - _1,0), - boost::bind( - &B2DPolygon::getB2DPoint, - _2,0))); + [](const auto& p1, const auto& p2) { return compare( p1.getB2DPoint(0), p2.getB2DPoint(0) ); }); return aRes; } diff --git a/main/desktop/source/deployment/manager/dp_extensionmanager.cxx b/main/desktop/source/deployment/manager/dp_extensionmanager.cxx index 4e77b03087..6e0a161853 100644 --- a/main/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/main/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -57,7 +57,6 @@ #include "dp_extensionmanager.hxx" #include "dp_commandenvironments.hxx" #include "dp_properties.hxx" -#include "boost/bind.hpp" #include <list> #include <unordered_map> @@ -1550,8 +1549,8 @@ void ExtensionManager::fireModified() util::XModifyListener::static_type() ); if (pContainer != 0) { pContainer->forEach<util::XModifyListener>( - boost::bind(&util::XModifyListener::modified, _1, - lang::EventObject(static_cast<OWeakObject *>(this))) ); + [this](const auto& listener) { listener->modified( + lang::EventObject(static_cast<OWeakObject *>(this))) }); } } diff --git a/main/desktop/source/deployment/manager/dp_manager.cxx b/main/desktop/source/deployment/manager/dp_manager.cxx index 94c8ced23a..a44ccba2e7 100644 --- a/main/desktop/source/deployment/manager/dp_manager.cxx +++ b/main/desktop/source/deployment/manager/dp_manager.cxx @@ -57,7 +57,6 @@ #include "com/sun/star/deployment/Prerequisites.hpp" #include "com/sun/star/task/XInteractionApprove.hpp" #include "com/sun/star/ucb/UnsupportedCommandException.hpp" -#include "boost/bind.hpp" #include "tools/urlobj.hxx" #include "unotools/tempfile.hxx" @@ -496,8 +495,8 @@ void PackageManagerImpl::fireModified() util::XModifyListener::static_type() ); if (pContainer != 0) { pContainer->forEach<util::XModifyListener>( - boost::bind(&util::XModifyListener::modified, _1, - lang::EventObject(static_cast<OWeakObject *>(this))) ); + [this](const auto& listener) { listener->modified( + lang::EventObject(static_cast<OWeakObject *>(this))) }); } } diff --git a/main/oox/source/drawingml/diagram/diagram.cxx b/main/oox/source/drawingml/diagram/diagram.cxx index d896073762..55522639e1 100644 --- a/main/oox/source/drawingml/diagram/diagram.cxx +++ b/main/oox/source/drawingml/diagram/diagram.cxx @@ -23,7 +23,6 @@ #include <functional> -#include <boost/bind.hpp> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Size.hpp> @@ -103,10 +102,10 @@ void DiagramData::dump() { OSL_TRACE("Dgm: DiagramData # of cnx: %d", maConnections.size() ); std::for_each( maConnections.begin(), maConnections.end(), - boost::bind( &dgm::Connection::dump, _1 ) ); + [](const auto& conn) { conn->dump(); } ); OSL_TRACE("Dgm: DiagramData # of pt: %d", maPoints.size() ); std::for_each( maPoints.begin(), maPoints.end(), - boost::bind( &dgm::Point::dump, _1 ) ); + [](const auto& pt) { pt->dump(); } ); } static void setPosition( const dgm::PointPtr & pPoint, const awt::Point & pt ) diff --git a/main/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/main/oox/source/drawingml/diagram/diagramlayoutatoms.cxx index 8c5ccaf3e5..c133d0b63a 100644 --- a/main/oox/source/drawingml/diagram/diagramlayoutatoms.cxx +++ b/main/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -24,7 +24,6 @@ #include "oox/drawingml/diagram/diagramlayoutatoms.hxx" #include <functional> -#include <boost/bind.hpp> #include "oox/helper/attributelist.hxx" #include "layoutnodecontext.hxx" @@ -84,7 +83,7 @@ void LayoutAtom::dump(int level) OUSTRING_TO_CSTR( msName ), typeid(*this).name() ); std::for_each( mpChildNodes.begin(), mpChildNodes.end(), - boost::bind( &LayoutAtom::dump, _1, level + 1 ) ); + [level](const auto& child) { child->dump( level + 1 ); } ); } @@ -92,7 +91,7 @@ void ForEachAtom::processAtom() { // TODO there is likely some conditions std::for_each( mpChildNodes.begin(), mpChildNodes.end(), - boost::bind( &LayoutAtom::processAtom, _1 ) ); + [](const auto& child) { child->processAtom(); } ); } /** call ConditionAtom::test() if pAtom is one @@ -119,7 +118,7 @@ void ChooseAtom::processAtom() { std::vector< LayoutAtomPtr >::iterator iter = std::find_if( mpChildNodes.begin(), mpChildNodes.end(), - boost::bind( &_test_atom, _1 ) ); + [](const auto& pAtom) { return _test_atom( pAtom ); } ); if( iter != mpChildNodes.end() ) { // TODO do something diff --git a/main/oox/source/ppt/timenode.cxx b/main/oox/source/ppt/timenode.cxx index 8ba59aee25..e7a7ecf61c 100644 --- a/main/oox/source/ppt/timenode.cxx +++ b/main/oox/source/ppt/timenode.cxx @@ -23,7 +23,6 @@ #include "oox/ppt/timenode.hxx" -#include <boost/bind.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/NamedValue.hpp> @@ -544,8 +543,7 @@ namespace oox { namespace ppt { } std::for_each( maChildren.begin(), maChildren.end(), - boost::bind(&TimeNode::addNode, _1, boost::cref(rFilter), boost::ref(xNode), - boost::ref(pSlide) ) ); + [this, &rFilter, &xNode, &pSlide](auto& child) { child->addNode( rFilter, xNode, pSlide ); } ); switch( mnNodeType ) { diff --git a/main/sal/osl/all/debugbase.cxx b/main/sal/osl/all/debugbase.cxx index 0c81495a64..4ed12a4516 100644 --- a/main/sal/osl/all/debugbase.cxx +++ b/main/sal/osl/all/debugbase.cxx @@ -29,7 +29,6 @@ #include "rtl/ustring.hxx" #include "osl/process.h" #include "osl/diagnose.hxx" -#include "boost/bind.hpp" #include <vector> #include <algorithm> @@ -98,7 +97,7 @@ bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName ) return true; OStringVec::const_iterator const iEnd( rVec.end() ); return std::find_if( rVec.begin(), iEnd, - boost::bind( &isSubStr, pName, _1 ) ) != iEnd; + [&](const auto& s) { return isSubStr( pName, s ); } ) != iEnd; } bool SAL_CALL osl_detail_ObjectRegistry_checkObjectCount( diff --git a/main/svx/source/gallery2/galbrws.cxx b/main/svx/source/gallery2/galbrws.cxx index ffe060bc0e..6535603888 100644 --- a/main/svx/source/gallery2/galbrws.cxx +++ b/main/svx/source/gallery2/galbrws.cxx @@ -35,7 +35,6 @@ #include "svx/galbrws.hxx" #include "GallerySplitter.hxx" -#include <boost/bind.hpp> // ------------------------- // - SvxGalleryChildWindow - @@ -88,10 +87,10 @@ GalleryBrowser::GalleryBrowser( this, GAL_RESID( GALLERY_BROWSER1 ), mpGallery, - ::boost::bind(&GalleryBrowser::KeyInput,this,_1,_2), - ::boost::bind(&GalleryBrowser::ThemeSelectionHasChanged, this)); + [this](auto& a1, auto& a2) { this->KeyInput( a1, a2 ); }, + [this]() { this->ThemeSelectionHasChanged(); }); mpSplitter = new GallerySplitter( this, GAL_RESID( GALLERY_SPLITTER ), - ::boost::bind(&GalleryBrowser::InitSettings, this)); + [this]() { this->InitSettings(); }); mpBrowser2 = new GalleryBrowser2( this, GAL_RESID( GALLERY_BROWSER2 ), mpGallery ); FreeResource(); diff --git a/main/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/main/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 41e5b37ff3..cc4b920b97 100644 --- a/main/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/main/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -63,7 +63,6 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/controlprimitive2d.hxx> -#include <boost/bind.hpp> /* @@ -1150,7 +1149,7 @@ namespace sdr { namespace contact { } m_bCreatingControl = true; - ::comphelper::ScopeGuard aGuard( ::boost::bind( lcl_resetFlag, ::boost::ref( m_bCreatingControl ) ) ); + ::comphelper::ScopeGuard aGuard( [&]() { lcl_resetFlag( m_bCreatingControl ); } ); if ( m_aControl.is() ) { diff --git a/main/svx/source/unodraw/unoshape.cxx b/main/svx/source/unodraw/unoshape.cxx index 7acf7b8f9f..750ccba1ae 100644 --- a/main/svx/source/unodraw/unoshape.cxx +++ b/main/svx/source/unodraw/unoshape.cxx @@ -102,7 +102,6 @@ #include "unopolyhelper.hxx" #include <comphelper/scopeguard.hxx> -#include <boost/bind.hpp> using ::rtl::OUString; using namespace ::osl; @@ -1946,7 +1945,7 @@ void SAL_CALL SvxShape::setPropertyValues( const ::com::sun::star::uno::Sequence // make sure mbIsMultiPropertyCall and mpImpl->mpItemSet are // reseted even when an exception is thrown - const ::comphelper::ScopeGuard aGuard( boost::bind( &SvxShape::endSetPropertyValues, this ) ); + const ::comphelper::ScopeGuard aGuard( [this]() { this->endSetPropertyValues(); } ); mbIsMultiPropertyCall = sal_True;
