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 /sw/source/filter/ww8/ww8par6.cxx | |
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 'sw/source/filter/ww8/ww8par6.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index a27b27749c0a..f16ca7565bd7 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3621,8 +3621,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh if (nLen >= 4) { const SwAttrSet& aSet = m_pCurrentColl->GetAttrSet(); - std::unique_ptr<SvxUnderlineItem> pUnderline( - static_cast<SvxUnderlineItem *>(aSet.Get( RES_CHRATR_UNDERLINE, false ).Clone())); + std::unique_ptr<SvxUnderlineItem> pUnderline(aSet.Get(RES_CHRATR_UNDERLINE, false).Clone()); pUnderline->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ); m_pCurrentColl->SetFormatAttr( *pUnderline ); } @@ -3634,7 +3633,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh { if (nLen >= 4) { - std::unique_ptr<SvxUnderlineItem> pUnderline(static_cast<SvxUnderlineItem*>(m_xCurrentItemSet->Get(RES_CHRATR_UNDERLINE, false).Clone())); + std::unique_ptr<SvxUnderlineItem> pUnderline(m_xCurrentItemSet->Get(RES_CHRATR_UNDERLINE, false).Clone()); pUnderline->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ); m_xCurrentItemSet->Put( std::move(pUnderline) ); } @@ -5010,7 +5009,7 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8*, short nLen) = static_cast<const SvxBoxItem*>(GetFormatAttr( RES_BOX )); std::shared_ptr<SvxBoxItem> aBox(std::make_shared<SvxBoxItem>(RES_BOX)); if (pBox) - aBox.reset(static_cast<SvxBoxItem*>(pBox->Clone())); + aBox.reset(pBox->Clone()); short aSizeArray[5]={0}; SetBorder(*aBox, aBrcs, &aSizeArray[0], nBorder); @@ -5057,7 +5056,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh = static_cast<const SvxBoxItem*>(GetFormatAttr( RES_CHRATR_BOX )); if( pBox ) { - std::shared_ptr<SvxBoxItem> aBoxItem(static_cast<SvxBoxItem*>(pBox->Clone())); + std::shared_ptr<SvxBoxItem> aBoxItem(pBox->Clone()); WW8_BRCVer9 aBrc; int nBrcVer = (nId == NS_sprm::sprmCBrc) ? 9 : (m_bVer67 ? 6 : 8); |