summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-03-16 12:09:52 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-03-17 23:54:43 +0100
commit83963a33da88f47f6e9b865188f9ec442d1ad770 (patch)
tree2947fb667dac6c9f507d1125b766f95a0bf6f1e4
parentformatting/whitespace (diff)
downloadcore-83963a33da88f47f6e9b865188f9ec442d1ad770.tar.gz
core-83963a33da88f47f6e9b865188f9ec442d1ad770.zip
use unique_ptr instead of manual mem-mgmt
Change-Id: I68a3d1721fd6e1bcc206bdaec8dcf89a256b5ca1
-rw-r--r--sw/source/core/unocore/unostyle.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 3f8867275aab..e04256092a6a 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2685,7 +2685,7 @@ SwXPageStyle::~SwXPageStyle()
void SwXStyle::PutItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rVal, SwStyleBase_Impl& rBaseImpl)
{
// create a new SvxSetItem and get it's ItemSet as new target
- SvxSetItem* pNewSetItem = static_cast< SvxSetItem* >(pSetItem->Clone());
+ const std::unique_ptr<SvxSetItem> pNewSetItem(static_cast<SvxSetItem*>(pSetItem->Clone()));
SfxItemSet& rSetSet = pNewSetItem->GetItemSet();
// set parent to ItemSet to ensure XFILL_NONE as XFillStyleItem
@@ -2703,7 +2703,6 @@ void SwXStyle::PutItemToSet(const SvxSetItem* pSetItem, const SfxItemPropertySet
// set the new SvxSetItem at the real target and delete it
rBaseImpl.GetItemSet().Put(*pNewSetItem);
- delete pNewSetItem;
}
void SwXPageStyle::SetPropertyValues_Impl(