diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-12 17:53:50 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-12 17:53:50 +0200 |
commit | af2d5119c620947da59434c6367514925ec75bb2 (patch) | |
tree | 958710a9b38954a930bcf44c859ed0ee27edcf56 /sc/source | |
parent | 0f8670ecebcf2af9c98b805c5e446ff073354d92 (diff) |
Use unique_ptr fro ScMergePatternState::pItemSet
Change-Id: I672785b273eaa8862f43112d7f25ae495b65b0c7
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/attarray.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 9f5141402043..28fd7e5681a4 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -19,6 +19,7 @@ #include "attarray.hxx" #include "scitems.hxx" +#include <o3tl/make_unique.hxx> #include <svx/algitem.hxx> #include <editeng/boxitem.hxx> #include <editeng/lineitem.hxx> @@ -1017,7 +1018,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, else { // first pattern - copied from parent - rState.pItemSet = new SfxItemSet( *rThisSet.GetPool(), rThisSet.GetRanges() ); + rState.pItemSet = o3tl::make_unique<SfxItemSet>( *rThisSet.GetPool(), rThisSet.GetRanges() ); rState.pItemSet->Set( rThisSet, bDeep ); rState.mnPatternId = pPattern->GetKey(); } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 33860d081b33..90e126d588bc 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4983,7 +4983,7 @@ ScPatternAttr* ScDocument::CreateSelectionPattern( const ScMarkData& rMark, bool OSL_ENSURE( aState.pItemSet, "SelectionPattern Null" ); if (aState.pItemSet) { - ScPatternAttr* pPattern = new ScPatternAttr( aState.pItemSet ); + ScPatternAttr* pPattern = new ScPatternAttr( aState.pItemSet.release() ); if (aState.mbValidPatternId) pPattern->SetKey(aState.mnPatternId); |