summaryrefslogtreecommitdiff
path: root/svx/source
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 /svx/source
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 'svx/source')
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx7
-rw-r--r--svx/source/unodraw/unoshape.cxx16
2 files changed, 7 insertions, 16 deletions
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 56d23b6851bd..5a798b5b4e1c 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -51,18 +51,17 @@ namespace sdr
}
DefaultProperties::DefaultProperties(const DefaultProperties& rProps, SdrObject& rObj)
- : BaseProperties(rObj),
- mpItemSet(nullptr)
+ : BaseProperties(rObj)
{
if(rProps.mpItemSet)
{
// Clone may be to another model and thus another ItemPool.
// SfxItemSet supports that thus we are able to Clone all
// SfxItemState::SET items to the target pool.
- mpItemSet.reset(
+ mpItemSet =
rProps.mpItemSet->Clone(
true,
- &rObj.getSdrModelFromSdrObject().GetItemPool()));
+ &rObj.getSdrModelFromSdrObject().GetItemPool());
// React on ModelChange: If metric has changed, scale items.
// As seen above, clone is supported, but scale is not included,
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index b8bdbe02fee0..6603f5a18e22 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -112,7 +112,7 @@ class GDIMetaFile;
struct SvxShapeImpl
{
SvxShape& mrAntiImpl;
- SfxItemSet* mpItemSet;
+ std::unique_ptr<SfxItemSet> mpItemSet;
sal_uInt32 mnObjId;
SvxShapeMaster* mpMaster;
bool mbHasSdrObjectOwnership;
@@ -131,7 +131,6 @@ struct SvxShapeImpl
SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex )
:mrAntiImpl( _rAntiImpl )
- ,mpItemSet( nullptr )
,mnObjId( 0 )
,mpMaster( nullptr )
,mbHasSdrObjectOwnership( false )
@@ -1631,12 +1630,9 @@ void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any&
{
if( mpImpl->mpItemSet == nullptr )
{
- pSet = mpImpl->mpItemSet = GetSdrObject()->GetMergedItemSet().Clone();
- }
- else
- {
- pSet = mpImpl->mpItemSet;
+ mpImpl->mpItemSet = GetSdrObject()->GetMergedItemSet().Clone();
}
+ pSet = mpImpl->mpItemSet.get();
}
else
{
@@ -1808,11 +1804,7 @@ void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >&
void SvxShape::endSetPropertyValues()
{
mbIsMultiPropertyCall = false;
- if( mpImpl->mpItemSet )
- {
- delete mpImpl->mpItemSet;
- mpImpl->mpItemSet = nullptr;
- }
+ mpImpl->mpItemSet.reset();
}