summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc/srtdlg.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-18 17:09:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-20 11:31:47 +0200
commitb42c7f2def7425dd379204a5bd15481e840093ed (patch)
treee7897eb920b046652a431f8758d49a0567741b0d /sw/source/ui/misc/srtdlg.cxx
parent92fe6fed58d3166740ab00a274e4c69562b20d0e (diff)
use std::unique_ptr in SwSortOptions
Change-Id: I5854e1492388d765a0503193a45f7c0f1bd14004 Reviewed-on: https://gerrit.libreoffice.org/43528 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/misc/srtdlg.cxx')
-rw-r--r--sw/source/ui/misc/srtdlg.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index 990ea0183721..2f95f2fe170a 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -41,6 +41,7 @@
#include <swtable.hxx>
#include <node.hxx>
#include <tblsel.hxx>
+#include <o3tl/make_unique.hxx>
#include <sfx2/request.hxx>
#include <memory>
@@ -317,9 +318,9 @@ void SwSortDlg::Apply()
else if( nullptr != (pUserData = m_pTypDLB1->GetSelectedEntryData()) )
sEntry = *static_cast<OUString*>(pUserData);
- SwSortKey *pKey = new SwSortKey( nCol1, sEntry,
- bAsc1 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.push_back( pKey );
+ aOptions.aKeys.push_back(
+ o3tl::make_unique<SwSortKey>( nCol1, sEntry,
+ bAsc1 ? SRT_ASCENDING : SRT_DESCENDING ));
}
if( bCheck2 )
@@ -330,9 +331,9 @@ void SwSortDlg::Apply()
else if( nullptr != (pUserData = m_pTypDLB2->GetSelectedEntryData()) )
sEntry = *static_cast<OUString*>(pUserData);
- SwSortKey *pKey = new SwSortKey( nCol2, sEntry,
- bAsc2 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.push_back( pKey );
+ aOptions.aKeys.push_back(
+ o3tl::make_unique<SwSortKey>( nCol2, sEntry,
+ bAsc2 ? SRT_ASCENDING : SRT_DESCENDING ));
}
if( bCheck3 )
@@ -343,9 +344,9 @@ void SwSortDlg::Apply()
else if( nullptr != (pUserData = m_pTypDLB3->GetSelectedEntryData()) )
sEntry = *static_cast<OUString*>(pUserData);
- SwSortKey *pKey = new SwSortKey( nCol3, sEntry,
- bAsc3 ? SRT_ASCENDING : SRT_DESCENDING );
- aOptions.aKeys.push_back( pKey );
+ aOptions.aKeys.push_back(
+ o3tl::make_unique<SwSortKey>( nCol3, sEntry,
+ bAsc3 ? SRT_ASCENDING : SRT_DESCENDING ));
}
aOptions.eDirection = bCol ? SRT_COLUMNS : SRT_ROWS;