summaryrefslogtreecommitdiff
path: root/ucb/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-27 15:46:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-27 20:45:54 +0200
commitcd023b8f8383aae3fbb053c40949843c8a50514b (patch)
treee3dc45f9835d91e3a7b5cde781e57e9f2489908e /ucb/source
parentfd7787b6f0f082db320ebe7b29fc5333587b5d2e (diff)
no need to allocate ListenerMap on the heap
it is a movable type Change-Id: I2b5c8524115016b53ec5cb28312ff4d749e27368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/file/bc.cxx4
-rw-r--r--ucb/source/ucp/file/filnot.cxx8
-rw-r--r--ucb/source/ucp/file/filnot.hxx4
3 files changed, 8 insertions, 8 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index d85a214063ba..e79d5ba2b0b9 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1187,13 +1187,13 @@ BaseContent::cPCL()
if( seqNames.hasElements() )
{
- std::unique_ptr<ListenerMap> listener(new ListenerMap);
+ ListenerMap listener;
for( const auto& rName : seqNames )
{
cppu::OInterfaceContainerHelper* pContainer = m_pPropertyListener->getContainer(rName);
if (!pContainer)
continue;
- (*listener)[rName] = pContainer->getElements();
+ listener[rName] = pContainer->getElements();
}
p.reset( new PropertyChangeNotifier( this, std::move(listener) ) );
diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx
index 19a9d2e0b141..d1f1b830bf95 100644
--- a/ucb/source/ucp/file/filnot.cxx
+++ b/ucb/source/ucp/file/filnot.cxx
@@ -192,9 +192,9 @@ PropertySetInfoChangeNotifier::notifyPropertyRemoved( const OUString & aProperty
PropertyChangeNotifier::PropertyChangeNotifier(
const css::uno::Reference< XContent >& xCreatorContent,
- std::unique_ptr<ListenerMap> pListeners )
+ ListenerMap&& pListeners )
: m_xCreatorContent( xCreatorContent ),
- m_pListeners( std::move(pListeners) )
+ m_aListeners( std::move(pListeners) )
{
}
@@ -214,7 +214,7 @@ void PropertyChangeNotifier::notifyPropertyChanged(
// notify listeners for all Events
- uno::Sequence< uno::Reference< uno::XInterface > > seqList = (*m_pListeners)[ OUString() ];
+ uno::Sequence< uno::Reference< uno::XInterface > > seqList = m_aListeners[ OUString() ];
for( const auto& rListener : std::as_const(seqList) )
{
uno::Reference< beans::XPropertiesChangeListener > aListener( rListener,uno::UNO_QUERY );
@@ -228,7 +228,7 @@ void PropertyChangeNotifier::notifyPropertyChanged(
for( const auto& rChange : std::as_const(Changes) )
{
seq[0] = rChange;
- seqList = (*m_pListeners)[ rChange.PropertyName ];
+ seqList = m_aListeners[ rChange.PropertyName ];
for( const auto& rListener : std::as_const(seqList) )
{
diff --git a/ucb/source/ucp/file/filnot.hxx b/ucb/source/ucp/file/filnot.hxx
index 95bcc8328a48..76730c1ddcfa 100644
--- a/ucb/source/ucp/file/filnot.hxx
+++ b/ucb/source/ucp/file/filnot.hxx
@@ -83,11 +83,11 @@ namespace fileaccess {
{
private:
css::uno::Reference< css::ucb::XContent > m_xCreatorContent;
- std::unique_ptr<ListenerMap> m_pListeners;
+ ListenerMap m_aListeners;
public:
PropertyChangeNotifier(
const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
- std::unique_ptr<ListenerMap> pListeners );
+ ListenerMap&& pListeners );
~PropertyChangeNotifier();