diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-11 10:46:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-11 13:32:44 +0200 |
commit | e7c22593d16d304264d3a343b549bf188975cdd6 (patch) | |
tree | 519280f25049d08afb62f42f8e79a9d747492818 /canvas | |
parent | 13fa6834c96d3607b44c48027e50b12024cc9f1d (diff) |
loplugin:moveparam in canvas
Change-Id: I12538ca8c3578f37a4ef1e40640f5324bbdbb1d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123371
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/inc/base/graphicdevicebase.hxx | 21 | ||||
-rw-r--r-- | canvas/inc/propertysethelper.hxx | 2 | ||||
-rw-r--r-- | canvas/source/tools/propertysethelper.cxx | 6 |
3 files changed, 15 insertions, 14 deletions
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 |