summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/futempl.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index 3f281141c908..df2a92a8e415 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -439,71 +439,64 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLBITMAP );
- SfxPoolItem* pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_LINEDASH ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEDASH );
- SfxPoolItem* pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_LINESTART ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINESTART );
- SfxPoolItem* pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_LINEEND ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEEND );
- SfxPoolItem* pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLGRADIENT );
- SfxPoolItem* pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLFLOATTRANSPARENCE );
- SfxPoolItem* pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}
if( rAttr.GetItemState( XATTR_FILLHATCH ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLHATCH );
- SfxPoolItem* pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc );
if( pNewItem )
{
rAttr.Put( *pNewItem );
- delete pNewItem;
}
}