diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-11 20:57:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-12 21:12:10 +0100 |
commit | 2431477337f4ac4384ba615f76bfb5904f1a3b47 (patch) | |
tree | 6f676441983e9b3c8440600d09a49478353e1faf /include/svl/intitem.hxx | |
parent | 23cfd3d1004f5ddda8cd79878c00b6c64f20068c (diff) |
use covariant return type for SfxPoolItem::Clone
and can then remove some casting
Change-Id: Id821c32ca2cbcdb7f57ef7a5fa1960042e630ffc
Reviewed-on: https://gerrit.libreoffice.org/85022
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svl/intitem.hxx')
-rw-r--r-- | include/svl/intitem.hxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx index 5bf9785cbf43..92999568b7f2 100644 --- a/include/svl/intitem.hxx +++ b/include/svl/intitem.hxx @@ -33,7 +33,7 @@ public: explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0): CntByteItem(which, nValue) {} - virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override + virtual SfxByteItem* Clone(SfxItemPool * = nullptr) const override { return new SfxByteItem(*this); } }; @@ -64,7 +64,7 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; - virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override; + virtual SfxInt16Item* Clone(SfxItemPool * = nullptr) const override; sal_Int16 GetValue() const { return m_nValue; } @@ -86,7 +86,7 @@ public: explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0): CntUInt16Item(which, nValue) {} - virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override + virtual SfxUInt16Item* Clone(SfxItemPool * = nullptr) const override { return new SfxUInt16Item(*this); } void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -102,7 +102,7 @@ public: explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0): CntInt32Item(which, nValue) {} - virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override + virtual SfxInt32Item* Clone(SfxItemPool * = nullptr) const override { return new SfxInt32Item(*this); } void dumpAsXml(xmlTextWriterPtr pWriter) const override; @@ -118,7 +118,7 @@ public: explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0): CntUInt32Item(which, nValue) {} - virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override + virtual SfxUInt32Item* Clone(SfxItemPool * = nullptr) const override { return new SfxUInt32Item(*this); } void dumpAsXml(xmlTextWriterPtr pWriter) const override; |