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 /editeng | |
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 'editeng')
-rw-r--r-- | editeng/source/items/paraitem.cxx | 10 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 18 |
2 files changed, 11 insertions, 17 deletions
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 52a8287cfecd..09b7e34106e8 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -1097,7 +1097,7 @@ SvxScriptSpaceItem::SvxScriptSpaceItem( bool bOn, const sal_uInt16 nId ) SfxPoolItem* SvxScriptSpaceItem::Clone( SfxItemPool * ) const { - return new SvxScriptSpaceItem( GetValue(), Which() ); + return new SvxScriptSpaceItem( *this ); } sal_uInt16 SvxScriptSpaceItem::GetVersion( sal_uInt16 nFFVer ) const @@ -1130,7 +1130,7 @@ SvxHangingPunctuationItem::SvxHangingPunctuationItem( SfxPoolItem* SvxHangingPunctuationItem::Clone( SfxItemPool * ) const { - return new SvxHangingPunctuationItem( GetValue(), Which() ); + return new SvxHangingPunctuationItem( *this ); } sal_uInt16 SvxHangingPunctuationItem::GetVersion( sal_uInt16 nFFVer ) const @@ -1163,7 +1163,7 @@ SvxForbiddenRuleItem::SvxForbiddenRuleItem( SfxPoolItem* SvxForbiddenRuleItem::Clone( SfxItemPool * ) const { - return new SvxForbiddenRuleItem( GetValue(), Which() ); + return new SvxForbiddenRuleItem( *this ); } sal_uInt16 SvxForbiddenRuleItem::GetVersion( sal_uInt16 nFFVer ) const @@ -1199,7 +1199,7 @@ SvxParaVertAlignItem::SvxParaVertAlignItem( Align nValue, SfxPoolItem* SvxParaVertAlignItem::Clone( SfxItemPool* ) const { - return new SvxParaVertAlignItem( GetValue(), Which() ); + return new SvxParaVertAlignItem( *this ); } sal_uInt16 SvxParaVertAlignItem::GetVersion( sal_uInt16 nFFVer ) const @@ -1259,7 +1259,7 @@ SvxParaGridItem::SvxParaGridItem( bool bOn, const sal_uInt16 nId ) SfxPoolItem* SvxParaGridItem::Clone( SfxItemPool * ) const { - return new SvxParaGridItem( GetValue(), Which() ); + return new SvxParaGridItem( *this ); } sal_uInt16 SvxParaGridItem::GetVersion( sal_uInt16 nFFVer ) const diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 8623ef42b061..54d065f48c8c 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1116,9 +1116,7 @@ void SvxTextLineItem::SetBoolValue( bool bVal ) SfxPoolItem* SvxTextLineItem::Clone( SfxItemPool * ) const { - SvxTextLineItem* pNew = new SvxTextLineItem( *this ); - pNew->SetColor( GetColor() ); - return pNew; + return new SvxTextLineItem( *this ); } @@ -1244,9 +1242,7 @@ SvxUnderlineItem::SvxUnderlineItem( const FontLineStyle eSt, const sal_uInt16 nI SfxPoolItem* SvxUnderlineItem::Clone( SfxItemPool * ) const { - SvxUnderlineItem* pNew = new SvxUnderlineItem( *this ); - pNew->SetColor( GetColor() ); - return pNew; + return new SvxUnderlineItem( *this ); } @@ -1297,9 +1293,7 @@ SvxOverlineItem::SvxOverlineItem( const FontLineStyle eSt, const sal_uInt16 nId SfxPoolItem* SvxOverlineItem::Clone( SfxItemPool * ) const { - SvxOverlineItem* pNew = new SvxOverlineItem( *this ); - pNew->SetColor( GetColor() ); - return pNew; + return new SvxOverlineItem( *this ); } @@ -2590,7 +2584,7 @@ SvxTextRotateItem::SvxTextRotateItem(sal_uInt16 nValue, const sal_uInt16 nW) SfxPoolItem* SvxTextRotateItem::Clone(SfxItemPool*) const { - return new SvxTextRotateItem(GetValue(), Which()); + return new SvxTextRotateItem(*this); } sal_uInt16 SvxTextRotateItem::GetVersion(sal_uInt16 nFFVer) const @@ -2680,7 +2674,7 @@ SvxCharRotateItem::SvxCharRotateItem( sal_uInt16 nValue, SfxPoolItem* SvxCharRotateItem::Clone( SfxItemPool* ) const { - return new SvxCharRotateItem( GetValue(), IsFitToLine(), Which() ); + return new SvxCharRotateItem( *this ); } sal_uInt16 SvxCharRotateItem::GetVersion( sal_uInt16 nFFVer ) const @@ -2774,7 +2768,7 @@ SvxCharScaleWidthItem::SvxCharScaleWidthItem( sal_uInt16 nValue, SfxPoolItem* SvxCharScaleWidthItem::Clone( SfxItemPool* ) const { - return new SvxCharScaleWidthItem( GetValue(), Which() ); + return new SvxCharScaleWidthItem( *this ); } |