[Libreoffice-commits] core.git: reportdesign/source

Jorenz Paragas j.paragas.237 at gmail.com
Tue Jun 30 06:29:28 PDT 2015


 reportdesign/source/core/sdr/PropertyForward.cxx      |    8 +--
 reportdesign/source/ui/inc/ViewsWindow.hxx            |   14 ------
 reportdesign/source/ui/inspection/GeometryHandler.cxx |    8 +--
 reportdesign/source/ui/report/ViewsWindow.cxx         |   40 +++++++++++++-----
 4 files changed, 37 insertions(+), 33 deletions(-)

New commits:
commit 02d3ae938d92988bb24b370ca0beece17bb275fa
Author: Jorenz Paragas <j.paragas.237 at gmail.com>
Date:   Mon Jun 29 19:56:20 2015 -0700

    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/16606
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
index b397155..3ef0438 100644
--- a/reportdesign/source/core/sdr/PropertyForward.cxx
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -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;
                         }
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index 00e0ac2..4950ec9 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -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;
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index fd218ba..19d9225 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -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
                 {
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index ee3dc31..e236b15 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -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


More information about the Libreoffice-commits mailing list