summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-08 08:29:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-09 08:47:50 +0200
commite0382c3ad7786910bc9aa81cf581798df0f2508c (patch)
tree6acb0196add99896ced2aa1a76ff5b432bc45401 /sd
parent38a684f72988f29e1c07bf9fa5a83e275e80e24c (diff)
avoid copying when placing items into SfxItemSet
Change-Id: I05c627f590e7794c1ba11b66021dc30aa3285eb0 Reviewed-on: https://gerrit.libreoffice.org/71941 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx3
-rw-r--r--sd/source/ui/func/fuolbull.cxx3
-rw-r--r--sd/source/ui/func/futempl.cxx14
-rw-r--r--sd/source/ui/view/drtxtob.cxx3
-rw-r--r--sd/source/ui/view/outlnvsh.cxx2
-rw-r--r--sd/source/ui/view/viewshel.cxx3
6 files changed, 12 insertions, 16 deletions
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index 1d71948dcc4d..a019f5da544f 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -96,8 +96,7 @@ OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAtt
DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in Pool! [CL]" );
- std::unique_ptr<SfxPoolItem> pNewItem(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
- m_aInputSet.Put(*pNewItem);
+ m_aInputSet.Put(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
}
if (m_bTitle && m_aInputSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 72262c7235f7..6680ebfc4761 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -335,8 +335,7 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u
//DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in the Pool!" );
- std::unique_ptr<SfxPoolItem> pNewItem(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
- aNewAttr.Put(*pNewItem);
+ aNewAttr.Put(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
if(bTitle && aNewAttr.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
{
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index b30f17008e41..5d918ddbd193 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -436,7 +436,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_LINEDASH ) == SfxItemState::SET )
@@ -445,7 +445,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_LINESTART ) == SfxItemState::SET )
@@ -454,7 +454,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_LINEEND ) == SfxItemState::SET )
@@ -463,7 +463,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SfxItemState::SET )
@@ -472,7 +472,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET )
@@ -481,7 +481,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
if( rAttr.GetItemState( XATTR_FILLHATCH ) == SfxItemState::SET )
@@ -490,7 +490,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
- rAttr.Put( *pNewItem );
+ rAttr.Put( std::move(pNewItem) );
}
}
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index a5694b2c5af3..bf4deae1094a 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -224,8 +224,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
}
else
{
- std::unique_ptr<SfxPoolItem> pNewItem(pI->CloneSetWhich(nWhich));
- aAttrSet.Put( *pNewItem );
+ aAttrSet.Put( pI->CloneSetWhich(nWhich) );
}
}
else
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 7f6e58798ac3..85ab5688c609 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1268,7 +1268,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
nZoomValues &= ~SvxZoomEnableFlags::PAGEWIDTH;
pZoomItem->SetValueSet( nZoomValues );
- rSet.Put( *pZoomItem );
+ rSet.Put( std::move(pZoomItem) );
}
if( SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_ZOOMSLIDER ) )
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 75fcbc469c32..09b321866f2e 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -893,8 +893,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16&
if( pItem == nullptr )
pItem = aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET);
- std::unique_ptr<SfxPoolItem> pNewItem(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
- aNewAttr.Put(*pNewItem);
+ aNewAttr.Put(pItem->CloneSetWhich(EE_PARA_NUMBULLET));
if(bTitle && aNewAttr.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET )
{