Kaydet (Commit) 623de483 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwUndoSort

Change-Id: I9e524c9c653fd4b1f61e407eee12ca3a7fdc14df
Reviewed-on: https://gerrit.libreoffice.org/57420
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 03a651d4
......@@ -61,9 +61,9 @@ typedef std::vector<SwNodeIndex*> SwUndoSortList;
class SwUndoSort : public SwUndo, private SwUndRng
{
SwSortOptions* pSortOpt;
std::unique_ptr<SwSortOptions> pSortOpt;
std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList;
SwUndoAttrTable* pUndoTableAttr;
std::unique_ptr<SwUndoAttrTable> pUndoTableAttr;
sal_uLong nTableNd;
public:
......
......@@ -48,7 +48,7 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
, pUndoTableAttr(nullptr)
, nTableNd(0)
{
pSortOpt = new SwSortOptions(rOpt);
pSortOpt.reset( new SwSortOptions(rOpt) );
}
SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTableNd,
......@@ -59,15 +59,15 @@ SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTabl
nEndNode = nEnd;
nTableNd = rTableNd.GetIndex();
pSortOpt = new SwSortOptions(rOpt);
pSortOpt.reset( new SwSortOptions(rOpt) );
if( bSaveTable )
pUndoTableAttr = new SwUndoAttrTable( rTableNd );
pUndoTableAttr.reset( new SwUndoAttrTable( rTableNd ) );
}
SwUndoSort::~SwUndoSort()
{
delete pSortOpt;
delete pUndoTableAttr;
pSortOpt.reset();
pUndoTableAttr.reset();
}
void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment