summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/formatclipboard.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-30 12:22:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-30 13:14:32 +0200
commite00c87caa399d37426d839f5264a747c115d0b12 (patch)
tree42418f076529d02e5bbbb405a48c65aacc478ae3 /sw/source/uibase/uiview/formatclipboard.cxx
parent492675180203b3409074923d7993429237611f99 (diff)
loplugin:makeshared in sw
Change-Id: I58d91e75ef96beaab7ec34df519ae3a376dce976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/uiview/formatclipboard.cxx')
-rw-r--r--sw/source/uibase/uiview/formatclipboard.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index d60fe21f3fb7..e9268bffa23f 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -158,13 +158,13 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
rSh.SetBoxBackground( *static_cast<const SvxBrushItem*>(pItem) );
if(pRowItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetRowBackground(*aBrush);
}
if(pTableItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetTabBackground(*aBrush);
}
@@ -416,8 +416,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
rWrtShell.EndAction();
}
-typedef std::shared_ptr< SfxPoolItem > SfxPoolItemSharedPtr;
-typedef std::vector< SfxPoolItemSharedPtr > ItemVector;
+typedef std::vector< std::unique_ptr< SfxPoolItem > > ItemVector;
// collect all PoolItems from the applied styles
static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSet )
{
@@ -429,7 +428,7 @@ static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyl
const SfxPoolItem* pItem;
if( SfxItemState::SET == rStyleAttrSet.GetItemState( nWhich, false, &pItem ) )
{
- rItemVector.push_back( SfxPoolItemSharedPtr( pItem->Clone() ) );
+ rItemVector.emplace_back( pItem->Clone() );
}
}
pRanges += 2;