From 2431477337f4ac4384ba615f76bfb5904f1a3b47 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 11 Dec 2019 20:57:45 +0000 Subject: use covariant return type for SfxPoolItem::Clone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and can then remove some casting Change-Id: Id821c32ca2cbcdb7f57ef7a5fa1960042e630ffc Reviewed-on: https://gerrit.libreoffice.org/85022 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/svl/intitem.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/svl/intitem.hxx') 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; -- cgit