canvas/inc/base/graphicdevicebase.hxx     |   21 +++++++++++----------
 canvas/inc/propertysethelper.hxx          |    2 +-
 canvas/source/tools/propertysethelper.cxx |    6 +++---
 3 files changed, 15 insertions(+), 14 deletions(-)

New commits:
commit e7c22593d16d304264d3a343b549bf188975cdd6
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Oct 11 10:46:32 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Oct 11 13:32:44 2021 +0200

    loplugin:moveparam in canvas
    
    Change-Id: I12538ca8c3578f37a4ef1e40640f5324bbdbb1d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123371
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/canvas/inc/base/graphicdevicebase.hxx 
b/canvas/inc/base/graphicdevicebase.hxx
index c17d7bbb8bc5..6045d32f3b30 100644
--- a/canvas/inc/base/graphicdevicebase.hxx
+++ b/canvas/inc/base/graphicdevicebase.hxx
@@ -118,16 +118,17 @@ namespace canvas
             maDeviceHelper(),
             mbDumpScreenContent(false)
         {
-            maPropHelper.initProperties( PropertySetHelper::MakeMap
-                ("HardwareAcceleration",
-                 [this] () { return this->maDeviceHelper.isAccelerated(); } )
-                ("DeviceHandle",
-                 [this] () { return this->maDeviceHelper.getDeviceHandle(); } )
-                ("SurfaceHandle",
-                 [this] () { return this->maDeviceHelper.getSurfaceHandle(); } 
)
-                ("DumpScreenContent",
-                 [this] () { return this->getDumpScreenContent(); },
-                 [this] (css::uno::Any const& rAny) { 
this->setDumpScreenContent(rAny); }));
+            maPropHelper.initProperties(
+                PropertySetHelper::InputMap {
+                    {"HardwareAcceleration",
+                        { [this] () { return 
this->maDeviceHelper.isAccelerated(); }, {} } },
+                    {"DeviceHandle",
+                        { [this] () { return 
this->maDeviceHelper.getDeviceHandle(); }, {} } },
+                    {"SurfaceHandle",
+                        { [this] () { return 
this->maDeviceHelper.getSurfaceHandle(); }, {} } },
+                    {"DumpScreenContent",
+                        { [this] () { return this->getDumpScreenContent(); },
+                          [this] (css::uno::Any const& rAny) { 
this->setDumpScreenContent(rAny); } } } } );
         }
 
         virtual void disposeThis() override
diff --git a/canvas/inc/propertysethelper.hxx b/canvas/inc/propertysethelper.hxx
index e1a37498bb37..ebce8ba556a4 100644
--- a/canvas/inc/propertysethelper.hxx
+++ b/canvas/inc/propertysethelper.hxx
@@ -105,7 +105,7 @@ namespace canvas
             a property, and reading/writing to this property is passed
             on to the given function pointer.
          */
-        void initProperties( const InputMap& rMap );
+        void initProperties( InputMap&& rMap );
 
         /** Add given properties to helper
 
diff --git a/canvas/source/tools/propertysethelper.cxx 
b/canvas/source/tools/propertysethelper.cxx
index 3f8bd4a4eef9..24a07cb7dc25 100644
--- a/canvas/source/tools/propertysethelper.cxx
+++ b/canvas/source/tools/propertysethelper.cxx
@@ -61,10 +61,10 @@ namespace canvas
     {
     }
 
-    void PropertySetHelper::initProperties( const InputMap& rMap )
+    void PropertySetHelper::initProperties( InputMap&& rMap )
     {
         mpMap.reset();
-        maMapEntries = rMap;
+        maMapEntries = std::move(rMap);
 
         std::sort( maMapEntries.begin(),
                    maMapEntries.end(),
@@ -83,7 +83,7 @@ namespace canvas
                         rMap.begin(),
                         rMap.end() );
 
-        initProperties( aMerged );
+        initProperties( std::move(aMerged) );
     }
 
     bool PropertySetHelper::isPropertyName( const OUString& aPropertyName ) 
const

Reply via email to