From 1db6e8b7760de1abd49d62df230d89480ffd2161 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Feb 2022 16:02:48 +0200 Subject: no need to use shared_ptr in PropertyChangeNotifier these things are never shared Change-Id: I21c3b7cf2abf6e47a8839ac60e7bf27b7282ed76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129784 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/unodraw/shapepropertynotifier.cxx | 4 ++-- svx/source/unodraw/unoshape.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'svx') diff --git a/svx/source/unodraw/shapepropertynotifier.cxx b/svx/source/unodraw/shapepropertynotifier.cxx index 9151190c0cda..6b2262e044f1 100644 --- a/svx/source/unodraw/shapepropertynotifier.cxx +++ b/svx/source/unodraw/shapepropertynotifier.cxx @@ -76,14 +76,14 @@ namespace svx { } - void PropertyChangeNotifier::registerProvider(const ShapeProperty _eProperty, const std::shared_ptr& _rProvider) + void PropertyChangeNotifier::registerProvider(const ShapeProperty _eProperty, std::unique_ptr _rProvider) { ENSURE_OR_THROW( !!_rProvider, "NULL factory not allowed." ); OSL_ENSURE( m_aProviders.find( _eProperty ) == m_aProviders.end(), "PropertyChangeNotifier::registerProvider: factory for this ID already present!" ); - m_aProviders[ _eProperty ] = _rProvider; + m_aProviders.emplace( _eProperty, std::move(_rProvider)); } void PropertyChangeNotifier::notifyPropertyChange( const ShapeProperty _eProperty ) const diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 4081e4d8128f..cb0aa12afd9a 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -325,9 +325,9 @@ svx::PropertyChangeNotifier& SvxShape::getShapePropertyChangeNotifier() void SvxShape::impl_construct() { mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Position, - std::make_shared( *mpImpl ) ); + std::make_unique( *mpImpl ) ); mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Size, - std::make_shared( *mpImpl ) ); + std::make_unique( *mpImpl ) ); if ( HasSdrObject() ) { -- cgit