summaryrefslogtreecommitdiff
path: root/framework/source/fwi/uielement
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-21 13:32:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-21 16:11:48 +0100
commit897970cd0b9709258b6b5b5fc05dba2e74a72b7c (patch)
tree45bd0da067e508cd233ca959b4d8bb7317260416 /framework/source/fwi/uielement
parent6b6f9fb71fa1bfcb438b89596e6f19529cfe1eba (diff)
loplugin:refcounting in framework
Change-Id: I2d7d14fe0335689e4a338c70587bf33137ed1ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111279 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/fwi/uielement')
-rw-r--r--framework/source/fwi/uielement/constitemcontainer.cxx5
-rw-r--r--framework/source/fwi/uielement/itemcontainer.cxx5
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx5
3 files changed, 9 insertions, 6 deletions
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx
index e02fb7aa3d9a..77952563d4f2 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -25,6 +25,7 @@
#include <comphelper/propertysetinfo.hxx>
#include <comphelper/servicehelper.hxx>
+#include <rtl/ref.hxx>
using namespace cppu;
using namespace com::sun::star::uno;
@@ -147,12 +148,12 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference
if ( rSubContainer.is() )
{
ItemContainer* pSource = comphelper::getUnoTunnelImplementation<ItemContainer>( rSubContainer );
- ConstItemContainer* pSubContainer( nullptr );
+ rtl::Reference<ConstItemContainer> pSubContainer;
if ( pSource )
pSubContainer = new ConstItemContainer( *pSource );
else
pSubContainer = new ConstItemContainer( rSubContainer );
- xReturn.set( static_cast< OWeakObject* >( pSubContainer ), UNO_QUERY );
+ xReturn = pSubContainer;
}
return xReturn;
diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx
index de2b047653ab..f9945deb9050 100644
--- a/framework/source/fwi/uielement/itemcontainer.cxx
+++ b/framework/source/fwi/uielement/itemcontainer.cxx
@@ -23,6 +23,7 @@
#include <uielement/itemcontainer.hxx>
#include <uielement/constitemcontainer.hxx>
#include <comphelper/servicehelper.hxx>
+#include <rtl/ref.hxx>
using namespace cppu;
using namespace com::sun::star::uno;
@@ -122,12 +123,12 @@ Reference< XIndexAccess > ItemContainer::deepCopyContainer( const Reference< XIn
if ( rSubContainer.is() )
{
ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer );
- ItemContainer* pSubContainer( nullptr );
+ rtl::Reference<ItemContainer> pSubContainer;
if ( pSource )
pSubContainer = new ItemContainer( *pSource, rMutex );
else
pSubContainer = new ItemContainer( rSubContainer, rMutex );
- xReturn.set( static_cast< OWeakObject* >( pSubContainer ), UNO_QUERY );
+ xReturn = pSubContainer;
}
return xReturn;
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index b570154f2eb0..8c573f12dbff 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -26,6 +26,7 @@
#include <properties.h>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <rtl/ref.hxx>
using namespace cppu;
using namespace com::sun::star::uno;
@@ -126,12 +127,12 @@ Reference< XIndexAccess > RootItemContainer::deepCopyContainer( const Reference<
if ( rSubContainer.is() )
{
ConstItemContainer* pSource = comphelper::getUnoTunnelImplementation<ConstItemContainer>( rSubContainer );
- ItemContainer* pSubContainer( nullptr );
+ rtl::Reference<ItemContainer> pSubContainer;
if ( pSource )
pSubContainer = new ItemContainer( *pSource, m_aShareMutex );
else
pSubContainer = new ItemContainer( rSubContainer, m_aShareMutex );
- xReturn.set( static_cast< OWeakObject* >( pSubContainer ), UNO_QUERY );
+ xReturn = pSubContainer;
}
return xReturn;