summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 09:56:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 14:08:27 +0200
commite5246409cc384cd2ba321620e92250f7ddf153af (patch)
treeeae4b87b9df1918bc69e081d87449a34ef483a99 /sd
parent1c0e591accda7669bec9ccfc23977ce3f7386930 (diff)
return std::unique_ptr from SfxItemSet::Clone
Change-Id: Ie747b5c8ff0b82b9f8d268f9a60dbde41b5f022b Reviewed-on: https://gerrit.libreoffice.org/52712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx4
-rw-r--r--sd/source/ui/view/drviews7.cxx6
2 files changed, 4 insertions, 6 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 7d85f27bb0e6..8a3d19ace163 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -725,7 +725,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
SfxPrinter *pTempPrinter = pDocSh->GetPrinter( true );
if (pTempPrinter)
{
- VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( std::unique_ptr<SfxItemSet>(pTempPrinter->GetOptions().Clone()), aPrinterName );
+ VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( pTempPrinter->GetOptions().Clone(), aPrinterName );
pDocSh->SetPrinter( pNewPrinter );
}
}
@@ -748,7 +748,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
bool bPreferPrinterPapersize = false;
if( pPrinter )
{
- pItemSet.reset(pPrinter->GetOptions().Clone());
+ pItemSet = pPrinter->GetOptions().Clone();
bPreferPrinterPapersize = pPrinter->GetPrinterSettingsPreferred();
}
else
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index b416561ae130..230d75c2e853 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1758,7 +1758,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
{
SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
const SfxItemSet &aPageItemSet = rPageProperties.GetItemSet();
- SfxItemSet *pTempSet = aPageItemSet.Clone(false, &mpDrawView->GetModel()->GetItemPool());
+ std::unique_ptr<SfxItemSet> pTempSet = aPageItemSet.Clone(false, &mpDrawView->GetModel()->GetItemPool());
rPageProperties.ClearItem(XATTR_FILLSTYLE);
rPageProperties.ClearItem(XATTR_FILLGRADIENT);
@@ -1792,7 +1792,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
// MigrateItemSet guarantees unique gradient names
SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} );
aMigrateSet.Put( aGradientItem );
- SdrModel::MigrateItemSet( &aMigrateSet, pTempSet, mpDrawView->GetModel() );
+ SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDrawView->GetModel() );
rPageProperties.PutItemSet( *pTempSet );
rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
@@ -1819,8 +1819,6 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
break;
}
- delete pTempSet;
-
rReq.Done();
}
else