summaryrefslogtreecommitdiff
path: root/forms/source/xforms
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-25 14:50:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-26 10:00:06 +0100
commit9c1ec551524a75c20c1468a6fc0101eb2480e8e3 (patch)
tree4e518f3dd6f7695c207dfa0ab6e80730965252e5 /forms/source/xforms
parent568b4e8d7a98da3d7f8f80c7e5a13d01676e96d6 (diff)
loplugin:refcounting in forms
Change-Id: Idba46c8b30a3c44f12c0aaa8a00477865ecfb848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111542 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/xforms')
-rw-r--r--forms/source/xforms/datatyperepository.cxx2
-rw-r--r--forms/source/xforms/datatypes.cxx8
-rw-r--r--forms/source/xforms/datatypes.hxx9
3 files changed, 10 insertions, 9 deletions
diff --git a/forms/source/xforms/datatyperepository.cxx b/forms/source/xforms/datatyperepository.cxx
index bb0bf4a34135..22a56ce545ee 100644
--- a/forms/source/xforms/datatyperepository.cxx
+++ b/forms/source/xforms/datatyperepository.cxx
@@ -131,7 +131,7 @@ namespace xforms
throw ElementExistException( OUString(), *this );
aTypePos = implLocate( sourceName );
- OXSDDataType* pClone = aTypePos->second->clone( newName );
+ rtl::Reference<OXSDDataType> pClone = aTypePos->second->clone( newName );
m_aRepository[ newName ] = pClone;
return pClone;
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx
index 91175dea907c..c4ce2d941bb4 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -89,9 +89,9 @@ namespace xforms
}
- OXSDDataType* OXSDDataType::clone( const OUString& _rNewName ) const
+ rtl::Reference<OXSDDataType> OXSDDataType::clone( const OUString& _rNewName ) const
{
- OXSDDataType* pClone = createClone( _rNewName );
+ rtl::Reference<OXSDDataType> pClone = createClone( _rNewName );
pClone->initializeClone( *this );
return pClone;
}
@@ -568,7 +568,7 @@ namespace xforms
{
}
- OXSDDataType* OBooleanType::createClone( const OUString& _rName ) const
+ rtl::Reference<OXSDDataType> OBooleanType::createClone( const OUString& _rName ) const
{
return new OBooleanType( _rName );
}
@@ -695,7 +695,7 @@ namespace xforms
:classname##_Base( _rName, DataTypeClass::typeclass ) \
{ \
} \
- OXSDDataType* classname::createClone( const OUString& _rName ) const \
+ rtl::Reference<OXSDDataType> classname::createClone( const OUString& _rName ) const \
{ \
return new classname( _rName ); \
} \
diff --git a/forms/source/xforms/datatypes.hxx b/forms/source/xforms/datatypes.hxx
index 18675d5f8959..9ccd85b7db95 100644
--- a/forms/source/xforms/datatypes.hxx
+++ b/forms/source/xforms/datatypes.hxx
@@ -30,6 +30,7 @@
#include <comphelper/propertycontainer.hxx>
#include <comphelper/proparrhlp.hxx>
#include <comphelper/broadcasthelper.hxx>
+#include <rtl/ref.hxx>
#include <unicode/regex.h>
@@ -101,7 +102,7 @@ namespace xforms
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
public:
- OXSDDataType* clone( const OUString& _rNewName ) const;
+ rtl::Reference<OXSDDataType> clone( const OUString& _rNewName ) const;
protected:
// XPropertySet and friends
@@ -113,7 +114,7 @@ namespace xforms
// --- own overridables ---
// helper for implementing cloning of data types
- virtual OXSDDataType* createClone( const OUString& _rName ) const = 0;
+ virtual rtl::Reference<OXSDDataType> createClone( const OUString& _rName ) const = 0;
virtual void initializeClone( const OXSDDataType& _rCloneSource );
// helper method for validate and explainInvalid
@@ -131,11 +132,11 @@ namespace xforms
//= helper for deriving from OXSDDataType
#define DECLARE_DEFAULT_CLONING( classname ) \
- virtual OXSDDataType* createClone( const OUString& _rName ) const override; \
+ virtual rtl::Reference<OXSDDataType> createClone( const OUString& _rName ) const override; \
virtual void initializeClone( const OXSDDataType& _rCloneSource ) override;
#define IMPLEMENT_DEFAULT_TYPED_CLONING( classname, baseclass ) \
- OXSDDataType* classname::createClone( const OUString& _rName ) const \
+ rtl::Reference<OXSDDataType> classname::createClone( const OUString& _rName ) const \
{ \
return new classname( _rName, getTypeClass() ); \
} \