Kaydet (Commit) 8bcea169 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwSdrUndo

Change-Id: I67276f2cd13cce8a7cb047216ead40c5afc384bd
Reviewed-on: https://gerrit.libreoffice.org/57423
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e7a25216
......@@ -36,8 +36,8 @@ class SwDoc;
// Undo for Draw Objects
class SwSdrUndo : public SwUndo
{
SdrUndoAction* pSdrUndo;
SdrMarkList* pMarkList; // MarkList for all selected SdrObjects
std::unique_ptr<SdrUndoAction> pSdrUndo;
std::unique_ptr<SdrMarkList> pMarkList; // MarkList for all selected SdrObjects
public:
SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList, const SwDoc* pDoc );
......
......@@ -75,27 +75,25 @@ SwSdrUndo::SwSdrUndo( SdrUndoAction* pUndo, const SdrMarkList* pMrkLst, const Sw
: SwUndo( SwUndoId::DRAWUNDO, pDoc ), pSdrUndo( pUndo )
{
if( pMrkLst && pMrkLst->GetMarkCount() )
pMarkList = new SdrMarkList( *pMrkLst );
else
pMarkList = nullptr;
pMarkList.reset( new SdrMarkList( *pMrkLst ) );
}
SwSdrUndo::~SwSdrUndo()
{
delete pSdrUndo;
delete pMarkList;
pSdrUndo.reset();
pMarkList.reset();
}
void SwSdrUndo::UndoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Undo();
rContext.SetSelections(nullptr, pMarkList);
rContext.SetSelections(nullptr, pMarkList.get());
}
void SwSdrUndo::RedoImpl(::sw::UndoRedoContext & rContext)
{
pSdrUndo->Redo();
rContext.SetSelections(nullptr, pMarkList);
rContext.SetSelections(nullptr, pMarkList.get());
}
OUString SwSdrUndo::GetComment() const
......
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