diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-29 16:15:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-30 09:28:07 +0100 |
commit | 19e715973e15f9e7cf6e8237643dbbc14f8eb87a (patch) | |
tree | 41d67c523f803a79791cea58e0b9ddc89de6a0eb /include/svl | |
parent | da02b574b4b077ba819350eec76a37eaf0ceeeb0 (diff) |
loplugin:useuniqueptr in MarkedUndoAction
Change-Id: Ic06b990112df5bc135cfd7af6f1129580f294428
Reviewed-on: https://gerrit.libreoffice.org/62509
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/undo.hxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx index 9451b9bd8e71..87c5196960f2 100644 --- a/include/svl/undo.hxx +++ b/include/svl/undo.hxx @@ -83,10 +83,10 @@ typedef sal_Int32 UndoStackMark; struct MarkedUndoAction { - SfxUndoAction* pAction; + std::unique_ptr<SfxUndoAction> pAction; ::std::vector< UndoStackMark > aMarks; - MarkedUndoAction(SfxUndoAction* p) : pAction(p) {} + MarkedUndoAction(std::unique_ptr<SfxUndoAction> p) : pAction(std::move(p)) {} }; /** do not make use of these implementation details, unless you @@ -102,10 +102,13 @@ struct SVL_DLLPUBLIC SfxUndoArray nMaxUndoActions(nMax), nCurUndoAction(0), pFatherUndoArray(nullptr) {} virtual ~SfxUndoArray(); - SfxUndoAction* GetUndoAction(size_t idx) { return maUndoActions[idx].pAction; } - void Remove(int idx); - void Remove( size_t i_pos, size_t i_count ); - void Insert( SfxUndoAction* i_action, size_t i_pos ); + SfxUndoArray& operator=( SfxUndoArray const & ) = delete; // MSVC2017 workaround + SfxUndoArray( SfxUndoArray const & ) = delete; // MSVC2017 workaround + + SfxUndoAction* GetUndoAction(size_t idx) { return maUndoActions[idx].pAction.get(); } + std::unique_ptr<SfxUndoAction> RemoveX(int idx); + void RemoveX( size_t i_pos, size_t i_count ); + void Insert( std::unique_ptr<SfxUndoAction> i_action, size_t i_pos ); }; |