chart2/source/controller/main/ObjectHierarchy.cxx |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

New commits:
commit 1a6e00363fcc2439f4fa43e165009c9a40f1ae84
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Jan 21 18:07:45 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Jan 22 11:22:05 2022 +0100

    simplify function object
    
    Change-Id: Iadba25f2c7ceae1dfc24de421b88ba9e8afb9155
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128738
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx 
b/chart2/source/controller/main/ObjectHierarchy.cxx
index 326d43461d9f..1fb449026f3a 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -61,21 +61,6 @@ using ::com::sun::star::uno::Sequence;
 namespace
 {
 
-struct lcl_ObjectToOID
-{
-    explicit lcl_ObjectToOID( const rtl::Reference<::chart::ChartModel> & 
xChartDoc ) :
-            m_xModel( xChartDoc )
-    {}
-
-    ::chart::ObjectIdentifier operator() ( const Reference< uno::XInterface > 
& xObj )
-    {
-        return ::chart::ObjectIdentifier( 
::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xObj, m_xModel 
) );
-    }
-
-private:
-    rtl::Reference<::chart::ChartModel> m_xModel;
-};
-
 void lcl_getChildOIDs(
     ::chart::ObjectHierarchy::tChildContainer& rOutChildren,
     const Reference< container::XIndexAccess >& xShapes )
@@ -238,9 +223,10 @@ void ObjectHierarchy::createAxesTree(
 
     Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( 
xDiagram, /* bOnlyVisible = */ true ) );
     if( !m_bOrderingForElementSelector )
-        std::transform( std::cbegin(aAxes), std::cend(aAxes),
-                      std::back_inserter( rContainer ),
-                      lcl_ObjectToOID( xChartDoc ));
+    {
+        for (const auto & rAxis : std::as_const(aAxes))
+            rContainer.push_back( 
ObjectIdentifier::createClassifiedIdentifierForObject( rAxis, xChartDoc ) );
+    }
 
     // get all axes, also invisible ones
     aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );

Reply via email to