From 3e61eb69ac1cff727072011e228eabfc8bc055c0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 May 2016 13:43:03 +0200 Subject: reportdesign: replace boost::bind with C++11 stuff Change-Id: Idd164e36d6f20a24123886ee1f15202c796eacc6 --- reportdesign/source/core/api/ReportDefinition.cxx | 23 +++++++++++------- reportdesign/source/filter/xml/xmlExport.cxx | 8 +++---- .../source/ui/inspection/GeometryHandler.cxx | 28 +++++++++++++++------- reportdesign/source/ui/report/ReportController.cxx | 4 +++- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 6addf6d7905c..4349d287c4b8 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -124,8 +124,6 @@ #include #include -#include - // page styles #define SC_UNO_PAGE_LEFTBORDER "LeftBorder" #define SC_UNO_PAGE_RIGHTBORDER "RightBorder" @@ -1081,7 +1079,8 @@ void SAL_CALL OReportDefinition::removeCloseListener( const uno::Reference< util } // XCloseable -void SAL_CALL OReportDefinition::close( sal_Bool _bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException, std::exception) +void SAL_CALL OReportDefinition::close(sal_Bool bDeliverOwnership) +throw (util::CloseVetoException, uno::RuntimeException, std::exception) { SolarMutexGuard aSolarGuard; @@ -1091,7 +1090,9 @@ void SAL_CALL OReportDefinition::close( sal_Bool _bDeliverOwnership ) throw (uti lang::EventObject aEvt( static_cast< ::cppu::OWeakObject* >( this ) ); aGuard.clear(); m_pImpl->m_aCloseListener.forEach( - ::boost::bind(&util::XCloseListener::queryClosing,_1,boost::cref(aEvt),boost::cref(_bDeliverOwnership))); + [&aEvt, &bDeliverOwnership] (uno::Reference const& xListener) { + return xListener->queryClosing(aEvt, bDeliverOwnership); + }); aGuard.reset(); @@ -1106,7 +1107,7 @@ void SAL_CALL OReportDefinition::close( sal_Bool _bDeliverOwnership ) throw (uti { uno::Reference< util::XCloseable> xFrame( (*aIter)->getFrame(), uno::UNO_QUERY ); if ( xFrame.is() ) - xFrame->close( _bDeliverOwnership ); + xFrame->close( bDeliverOwnership ); } catch (const util::CloseVetoException&) { throw; } catch (const uno::Exception&) @@ -1477,20 +1478,24 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS xStatusIndicator->end(); } -void SAL_CALL OReportDefinition::switchToStorage( const uno::Reference< embed::XStorage >& _xStorage ) throw (lang::IllegalArgumentException, io::IOException, uno::Exception, uno::RuntimeException, std::exception) +void SAL_CALL OReportDefinition::switchToStorage( + const uno::Reference< embed::XStorage >& xStorage) +throw (lang::IllegalArgumentException, io::IOException, uno::Exception, uno::RuntimeException, std::exception) { - if ( !_xStorage.is() ) + if (!xStorage.is()) throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_aProps->m_xContext->getServiceManager()),*this,1); { ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); - m_pImpl->m_xStorage = _xStorage; + m_pImpl->m_xStorage = xStorage; lcl_setModelReadOnly(m_pImpl->m_xStorage,m_pImpl->m_pReportModel); m_pImpl->m_pObjectContainer->SwitchPersistence(m_pImpl->m_xStorage); } // notify our container listeners m_pImpl->m_aStorageChangeListeners.forEach( - ::boost::bind(&document::XStorageChangeListener::notifyStorageChange,_1,static_cast(this),boost::cref(_xStorage))); + [this, &xStorage] (uno::Reference const& xListener) { + return xListener->notifyStorageChange(static_cast(this), xStorage); + }); } uno::Reference< embed::XStorage > SAL_CALL OReportDefinition::getDocumentStorage( ) throw (io::IOException, uno::Exception, uno::RuntimeException, std::exception) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 26a5b216372e..6ab1e188a649 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -56,8 +56,6 @@ #include #include -#include - #include #define DEFAULT_LINE_WIDTH 2 @@ -1200,8 +1198,10 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const ReferencesetPropertyValue(it, aEmpty); + } ::std::vector< XMLPropertyState > aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(xBorderProp)); ::std::copy(aBorderStates.begin(),aBorderStates.end(),::std::back_inserter(aPropertyStates)); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index cb7759f68d84..186428b0c5be 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -709,7 +709,10 @@ void GeometryHandler::implCreateListLikeControl( ); out_Descriptor.Control = xListControl.get(); - ::std::for_each( _aEntries.begin(), _aEntries.end(),::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl,_1 )); + for (auto const& it : _aEntries) + { + xListControl->appendListEntry(it); + } } @@ -812,10 +815,14 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const } else { - ::std::for_each( m_aFieldNames.getConstArray(), m_aFieldNames.getConstArray() + m_aFieldNames.getLength(), - ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl, _1 ) ); - ::std::for_each( m_aParamNames.getConstArray(), m_aParamNames.getConstArray() + m_aParamNames.getLength(), - ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl, _1 ) ); + for (auto const& it : m_aFieldNames) + { + xListControl->appendListEntry(it); + } + for (auto const& it : m_aParamNames) + { + xListControl->appendListEntry(it); + } } } break; @@ -1633,14 +1640,19 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, } } -void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< OUString >& _out_rList) const +void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< OUString >& out_rList) const { if ( m_nDataFieldType == FUNCTION ) - ::std::transform(m_aDefaultFunctions.begin(),m_aDefaultFunctions.end(),::std::back_inserter(_out_rList),::boost::bind( &DefaultFunction::getName, _1 )); + { + for (auto const& it : m_aDefaultFunctions) + { + out_rList.push_back(it.getName()); + } + } else if ( m_nDataFieldType == USER_DEF_FUNCTION ) ::std::transform( m_aFunctionNames.begin(), m_aFunctionNames.end(), - ::std::back_inserter(_out_rList), + ::std::back_inserter(out_rList), ::o3tl::select1st< TFunctions::value_type >() ); } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 1138d2ea741f..afbc800e5bda 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2604,7 +2604,9 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi } lang::EventObject aEvent(*this); m_aSelectionListeners.forEach( - ::boost::bind(&view::XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent))); + [&aEvent] (uno::Reference const& xListener) { + return xListener->selectionChanged(aEvent); + }); } } -- cgit