[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jan 18 06:50:57 UTC 2019
sw/source/core/attr/swatrset.cxx | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
New commits:
commit 0e4e58639231e2e7b6e48201b3d79b168ae4f07b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jan 17 16:47:43 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 18 07:50:26 2019 +0100
use unique_ptr in SwAttrSet
Change-Id: I8b30b76a0c45c8262bf03022c62639be86620bf9
Reviewed-on: https://gerrit.libreoffice.org/66551
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index a4e19fe39776..d2f792ec4e74 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -301,7 +301,7 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
if( Count() )
{
// #i92811#
- SfxStringItem* pNewListIdItem( nullptr );
+ std::unique_ptr<SfxStringItem> pNewListIdItem;
const SfxPoolItem* pItem;
const SwDoc *pSrcDoc = GetDoc();
@@ -355,9 +355,9 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
// Thus, create new list id item.
if (pSrcDocNumRule && sListId == pSrcDocNumRule->GetDefaultListId())
{
- pNewListIdItem = new SfxStringItem (
+ pNewListIdItem.reset(new SfxStringItem (
RES_PARATR_LIST_ID,
- pDstDocNumRule->GetDefaultListId() );
+ pDstDocNumRule->GetDefaultListId() ));
}
}
// check again, if list exist, because <SwDoc::MakeNumRule(..)>
@@ -435,10 +435,6 @@ void SwAttrSet::CopyToModify( SwModify& rMod ) const
{
pFormat->SetFormatAttr( *this );
}
-
- // #i92811#
- delete pNewListIdItem;
- pNewListIdItem = nullptr;
}
}
#if OSL_DEBUG_LEVEL > 0
More information about the Libreoffice-commits
mailing list