diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-24 09:58:49 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-24 10:31:18 +0200 |
commit | d772b9bdc442c767fe99da74df375e5ecf6c8454 (patch) | |
tree | 09c605059d340df4a9129fb432b6f4598e1f2e61 /forms/source/xforms | |
parent | c3dc46723234c3fd5101a26ff374e59140997582 (diff) |
loplugin:constantfunction: forms
Change-Id: Icb1b4bb3fd73b54378b77fbaa6c41c3a0f03706a
Diffstat (limited to 'forms/source/xforms')
-rw-r--r-- | forms/source/xforms/datatypes.cxx | 31 | ||||
-rw-r--r-- | forms/source/xforms/datatypes.hxx | 18 |
2 files changed, 19 insertions, 30 deletions
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx index 2bc451044768..f3a156c3bcea 100644 --- a/forms/source/xforms/datatypes.cxx +++ b/forms/source/xforms/datatypes.cxx @@ -605,14 +605,15 @@ namespace xforms { } - - IMPLEMENT_DEFAULT_CLONING( OBooleanType, OBooleanType_Base ) - - - void OBooleanType::initializeTypedClone( const OBooleanType& /*_rCloneSource*/ ) + OXSDDataType* OBooleanType::createClone( const OUString& _rName ) const { + return new OBooleanType( _rName ); } + void OBooleanType::initializeClone( const OXSDDataType& _rCloneSource ) + { + OBooleanType_Base::initializeClone( _rCloneSource ); + } sal_uInt16 OBooleanType::_validate( const OUString& sValue ) { @@ -737,12 +738,15 @@ namespace xforms :classname##_Base( _rName, DataTypeClass::typeclass ) \ { \ } \ - \ - IMPLEMENT_DEFAULT_CLONING( classname, classname##_Base ) \ - \ - void classname::initializeTypedClone( const classname& /*_rCloneSource*/ ) \ - { \ - } \ + OXSDDataType* classname::createClone( const OUString& _rName ) const \ + { \ + return new classname( _rName ); \ + } \ + void classname::initializeClone( const OXSDDataType& _rCloneSource ) \ + { \ + classname##_Base::initializeClone( _rCloneSource ); \ + initializeTypedClone( static_cast< const classname& >( _rCloneSource ) ); \ + } \ @@ -906,11 +910,6 @@ namespace xforms IMPLEMENT_DEFAULT_TYPED_CLONING( OShortIntegerType, OShortIntegerType_Base ) - void OShortIntegerType::initializeTypedClone( const OShortIntegerType& /*_rCloneSource*/ ) - { - } - - bool OShortIntegerType::_getValue( const OUString& value, double& fValue ) { fValue = (double)(sal_Int16)value.toInt32(); diff --git a/forms/source/xforms/datatypes.hxx b/forms/source/xforms/datatypes.hxx index 848ff75e5dac..a2422bea6ac8 100644 --- a/forms/source/xforms/datatypes.hxx +++ b/forms/source/xforms/datatypes.hxx @@ -139,19 +139,7 @@ namespace xforms #define DECLARE_DEFAULT_CLONING( classname ) \ virtual OXSDDataType* createClone( const OUString& _rName ) const SAL_OVERRIDE; \ - virtual void initializeClone( const OXSDDataType& _rCloneSource ) SAL_OVERRIDE; \ - void initializeTypedClone( const classname& _rCloneSource ); - -#define IMPLEMENT_DEFAULT_CLONING( classname, baseclass ) \ - OXSDDataType* classname::createClone( const OUString& _rName ) const \ - { \ - return new classname( _rName ); \ - } \ - void classname::initializeClone( const OXSDDataType& _rCloneSource ) \ - { \ - baseclass::initializeClone( _rCloneSource ); \ - initializeTypedClone( static_cast< const classname& >( _rCloneSource ) ); \ - } \ + virtual void initializeClone( const OXSDDataType& _rCloneSource ) SAL_OVERRIDE; #define IMPLEMENT_DEFAULT_TYPED_CLONING( classname, baseclass ) \ OXSDDataType* classname::createClone( const OUString& _rName ) const \ @@ -162,7 +150,7 @@ namespace xforms { \ baseclass::initializeClone( _rCloneSource ); \ initializeTypedClone( static_cast< const classname& >( _rCloneSource ) ); \ - } \ + } #define REGISTER_VOID_PROP( prop, memberAny, type ) \ registerMayBeVoidProperty( PROPERTY_##prop, PROPERTY_ID_##prop, ::com::sun::star::beans::PropertyAttribute::BOUND | ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, \ @@ -288,6 +276,7 @@ namespace xforms protected: DECLARE_DEFAULT_CLONING( OStringType ) + void initializeTypedClone( const OStringType& _rCloneSource ); // OXSDDataType overridables virtual sal_uInt16 _validate( const OUString& value ) SAL_OVERRIDE; @@ -309,6 +298,7 @@ namespace xforms protected: DECLARE_DEFAULT_CLONING( ODecimalType ) + void initializeTypedClone( const ODecimalType& _rCloneSource ); // OXSDDataType overridables virtual sal_uInt16 _validate( const OUString& value ) SAL_OVERRIDE; |