diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-24 08:37:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-24 10:53:05 +0200 |
commit | 57de1a3c279d4ecfaa020626296f7e667765e5a3 (patch) | |
tree | f7d49701357ae4ccb4729bbf9fd50ceac6801393 /sw | |
parent | 90e3b47b52f26420425a7417d2f51b6a386282d9 (diff) |
simplify call sites of SfxItemPool::Put
use template to make return type match input type, so we don't need to
cast at the call sites
Change-Id: I1e65f362c67f74c9a230cdbc1db12545b28eb499
Reviewed-on: https://gerrit.libreoffice.org/71216
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/undo/rolbck.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/writer/writer.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index b2782a55532f..1c5e6098f0d2 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -467,7 +467,7 @@ void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool ) // set the footnote in the TextNode SwFormatFootnote aTemp( m_bEndNote ); SwFormatFootnote& rNew = const_cast<SwFormatFootnote&>( - static_cast<const SwFormatFootnote&>(pDoc->GetAttrPool().Put(aTemp)) ); + pDoc->GetAttrPool().Put(aTemp) ); if ( !m_FootnoteNumber.isEmpty() ) { rNew.SetNumStr( m_FootnoteNumber ); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 8b5c2406b181..c374d261ce65 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -420,10 +420,10 @@ void Writer::AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont ) { SvxFontItem aFont( rFont ); aFont.SetWhich( RES_CHRATR_FONT ); - pItem = static_cast<const SvxFontItem*>(&rPool.Put( aFont )); + pItem = &rPool.Put( aFont ); } else - pItem = static_cast<const SvxFontItem*>(&rPool.Put( rFont )); + pItem = &rPool.Put( rFont ); if( 1 < pItem->GetRefCount() ) rPool.Remove( *pItem ); |