diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-11-12 11:55:28 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-12 14:47:00 +0100 |
commit | d73225119476de1826f648acca9e93bf6797e813 (patch) | |
tree | a8061daec36f66550b58515b4dc8131feea0ead5 /sw | |
parent | 3168c5e09f084e65a32b5865d975ea9a9524d7c3 (diff) |
use copy constructor to clone PoolItems
Change-Id: I2a45a62fd56cc5a768406c7a6e4c72456f962367
Reviewed-on: https://gerrit.libreoffice.org/44648
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/graphic/grfatr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 20 |
2 files changed, 9 insertions, 13 deletions
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx index 07f1b980db6b..545ee807ea0c 100644 --- a/sw/source/core/graphic/grfatr.cxx +++ b/sw/source/core/graphic/grfatr.cxx @@ -149,7 +149,7 @@ SfxPoolItem* SwCropGrf::Clone( SfxItemPool* ) const SfxPoolItem* SwRotationGrf::Clone( SfxItemPool * ) const { - return new SwRotationGrf( GetValue(), aUnrotatedSize ); + return new SwRotationGrf( *this ); } bool SwRotationGrf::operator==( const SfxPoolItem& rCmp ) const diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index dcf2458da246..ab52c310ec93 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1315,7 +1315,7 @@ bool SwFormatVertOrient::operator==( const SfxPoolItem& rAttr ) const SfxPoolItem* SwFormatVertOrient::Clone( SfxItemPool* ) const { - return new SwFormatVertOrient( m_nYPos, m_eOrient, m_eRelation ); + return new SwFormatVertOrient( *this ); } bool SwFormatVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1409,7 +1409,7 @@ bool SwFormatHoriOrient::operator==( const SfxPoolItem& rAttr ) const SfxPoolItem* SwFormatHoriOrient::Clone( SfxItemPool* ) const { - return new SwFormatHoriOrient( m_nXPos, m_eOrient, m_eRelation, m_bPosToggle ); + return new SwFormatHoriOrient( *this ); } bool SwFormatHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1870,22 +1870,22 @@ bool SwFormatURL::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) SfxPoolItem* SwFormatEditInReadonly::Clone( SfxItemPool* ) const { - return new SwFormatEditInReadonly( Which(), GetValue() ); + return new SwFormatEditInReadonly( *this ); } SfxPoolItem* SwFormatLayoutSplit::Clone( SfxItemPool* ) const { - return new SwFormatLayoutSplit( GetValue() ); + return new SwFormatLayoutSplit( *this ); } SfxPoolItem* SwFormatRowSplit::Clone( SfxItemPool* ) const { - return new SwFormatRowSplit( GetValue() ); + return new SwFormatRowSplit( *this ); } SfxPoolItem* SwFormatNoBalancedColumns::Clone( SfxItemPool* ) const { - return new SwFormatNoBalancedColumns( GetValue() ); + return new SwFormatNoBalancedColumns( *this ); } void SwFormatNoBalancedColumns::dumpAsXml(xmlTextWriterPtr pWriter) const @@ -2024,18 +2024,14 @@ bool SwFormatFootnoteEndAtTextEnd::PutValue( const uno::Any& rVal, sal_uInt8 nMe SfxPoolItem* SwFormatFootnoteAtTextEnd::Clone( SfxItemPool* ) const { - SwFormatFootnoteAtTextEnd* pNew = new SwFormatFootnoteAtTextEnd; - *pNew = *this; - return pNew; + return new SwFormatFootnoteAtTextEnd(*this); } // class SwFormatEndAtTextEnd SfxPoolItem* SwFormatEndAtTextEnd::Clone( SfxItemPool* ) const { - SwFormatEndAtTextEnd* pNew = new SwFormatEndAtTextEnd; - *pNew = *this; - return pNew; + return new SwFormatEndAtTextEnd(*this); } //class SwFormatChain |