Kaydet (Commit) 02d3ae93 authored tarafından Jorenz Paragas's avatar Jorenz Paragas Kaydeden (comit) Michael Stahl

tdf#91112 replace o3tl::compose1 with lambdas in reportdesign

Remove TReportPairHelper and TStartMarkerHelper as well since they
were helper structs that were used solely for many of these
o3tl::compose calls and are now unused.

Change-Id: I75b366a7951a841c49a34709a3bdc1877952b64d
Reviewed-on: https://gerrit.libreoffice.org/16606Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst daf06757
......@@ -119,11 +119,9 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt
aFind = ::std::find_if(
m_aNameMap.begin(),
m_aNameMap.end(),
::o3tl::compose1(
::std::bind2nd(::std::equal_to< OUString >(), evt.PropertyName),
::o3tl::compose1(::o3tl::select1st<TPropertyConverter>(),::o3tl::select2nd<TPropertyNamePair::value_type>())
)
);
[&evt] (TPropertyNamePair::value_type namePair) {
return namePair.second.first == evt.PropertyName;
});
if ( aFind != m_aNameMap.end() )
sPropName = aFind->first;
}
......
......@@ -109,20 +109,6 @@ namespace rptui
public:
typedef ::std::vector< VclPtr<OSectionWindow> > TSectionsMap;
struct TReportPairHelper : public ::std::unary_function< TSectionsMap::value_type, OReportSection >
{
OReportSection& operator() (const TSectionsMap::value_type& lhs) const
{
return lhs->getReportSection();
}
};
struct TStartMarkerHelper : public ::std::unary_function< TSectionsMap::value_type, OStartMarker >
{
OStartMarker& operator() (const TSectionsMap::value_type& lhs) const
{
return lhs->getStartMarker();
}
};
private:
TSectionsMap m_aSections;
svtools::ColorConfig m_aColorConfig;
......
......@@ -805,10 +805,10 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
if ( m_nDataFieldType == USER_DEF_FUNCTION )
{
// add function names
::std::for_each( m_aFunctionNames.begin(), m_aFunctionNames.end(),
::o3tl::compose1(
::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl,_1 ),
::o3tl::select1st<TFunctions::value_type>()));
::std::for_each(m_aFunctionNames.begin(), m_aFunctionNames.end(),
[&xListControl] (TFunctions::value_type func) {
xListControl->appendListEntry(func.first);
});
}
else
{
......
......@@ -326,9 +326,13 @@ void OViewsWindow::removeSection(sal_uInt16 _nPosition)
void OViewsWindow::toggleGrid(bool _bVisible)
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OReportSection::SetGridVisible,_1,_bVisible),TReportPairHelper()));
[_bVisible] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().SetGridVisible(_bVisible);
});
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OReportSection::Window::Invalidate,_1,InvalidateFlags::NoErase),TReportPairHelper()));
[] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().Window::Invalidate(InvalidateFlags::NoErase);
});
}
sal_Int32 OViewsWindow::getTotalHeight() const
......@@ -363,7 +367,9 @@ void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType )
void OViewsWindow::SetMode( DlgEdMode eNewMode )
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper()));
[&eNewMode] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().SetMode(eNewMode);
});
}
bool OViewsWindow::HasSelection() const
......@@ -379,7 +385,9 @@ void OViewsWindow::Delete()
{
m_bInUnmark = true;
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::mem_fn(&OReportSection::Delete),TReportPairHelper()));
[] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().Delete();
});
m_bInUnmark = false;
}
......@@ -387,7 +395,9 @@ void OViewsWindow::Copy()
{
uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects;
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OReportSection::Copy,_1,::boost::ref(aAllreadyCopiedObjects)),TReportPairHelper()));
[&aAllreadyCopiedObjects] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().Copy(boost::ref(aAllreadyCopiedObjects));
});
OReportExchange* pCopy = new OReportExchange(aAllreadyCopiedObjects);
uno::Reference< datatransfer::XTransferable> aEnsureDelete = pCopy;
......@@ -400,7 +410,9 @@ void OViewsWindow::Paste()
OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aTransferData);
if ( aCopies.getLength() > 1 )
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OReportSection::Paste,_1,aCopies,false),TReportPairHelper()));
[&aCopies] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().Paste(aCopies, false);
});
else
{
OSectionWindow* pMarkedSection = getMarkedSection();
......@@ -502,7 +514,9 @@ void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType)
{
m_bInUnmark = true;
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(::boost::mem_fn(&OReportSection::SelectAll),_1,_nObjectType),TReportPairHelper()));
[&_nObjectType] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().SelectAll(_nObjectType);
});
m_bInUnmark = false;
}
......@@ -545,9 +559,13 @@ void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt )
void OViewsWindow::showRuler(bool _bShow)
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OStartMarker::showRuler,_1,_bShow),TStartMarkerHelper()));
[_bShow] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getStartMarker().showRuler(_bShow);
});
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::bind(&OStartMarker::Window::Invalidate, _1, InvalidateFlags::NoErase), TStartMarkerHelper()));
[] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getStartMarker().Window::Invalidate(InvalidateFlags::NoErase);
});
}
void OViewsWindow::MouseButtonUp( const MouseEvent& rMEvt )
......@@ -1671,7 +1689,9 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode)
void OViewsWindow::stopScrollTimer()
{
::std::for_each(m_aSections.begin(),m_aSections.end(),
::o3tl::compose1(::boost::mem_fn(&OReportSection::stopScrollTimer),TReportPairHelper()));
[] (TSectionsMap::value_type sectionPtr) {
sectionPtr->getReportSection().stopScrollTimer();
});
}
void OViewsWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment