[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 12 06:59:33 UTC 2018
sw/source/core/doc/docdraw.cxx | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 5928396cb2bb759fbbde68c1df50e1fa1ba07463
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 10 14:41:18 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 08:59:07 2018 +0200
loplugin:useuniqueptr in SwDoc::UnGroupSelection
Change-Id: Ib18a027e96f4ea14057c17f51345797b7d8746c2
Reviewed-on: https://gerrit.libreoffice.org/60347
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index a09301ecba71..07d024a3619e 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -312,11 +312,11 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
SwDrawView::ReplaceMarkedDrawVirtObjs( rDrawView );
const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList();
- std::vector< std::pair< SwDrawFrameFormat*, SdrObject* > >* pFormatsAndObjs( nullptr );
+ std::unique_ptr<std::vector< std::pair< SwDrawFrameFormat*, SdrObject* > >[]> pFormatsAndObjs;
const size_t nMarkCount( rMrkList.GetMarkCount() );
if ( nMarkCount )
{
- pFormatsAndObjs = new std::vector< std::pair< SwDrawFrameFormat*, SdrObject* > >[nMarkCount];
+ pFormatsAndObjs.reset( new std::vector< std::pair< SwDrawFrameFormat*, SdrObject* > >[nMarkCount] );
SdrObject *pMyObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
if( !pMyObj->getParentSdrObjectFromSdrObject() )
{
@@ -383,7 +383,6 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
}
}
}
- delete [] pFormatsAndObjs;
}
bool SwDoc::DeleteSelection( SwDrawView& rDrawView )
More information about the Libreoffice-commits
mailing list