diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-20 16:57:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-21 10:29:56 +0200 |
commit | f46f871f3170eb0d5a6522b7425c2390b601df5a (patch) | |
tree | 2c16d543e64279d2bb866113f8d0396d909ec8c7 /sc/inc/chgtrack.hxx | |
parent | b35fa7758d4eba2cac85527b0bd0c1dcf5ecfc09 (diff) |
loplugin:useuniqueptr in ScChangeTrack
Change-Id: I98f9263660c6c9cfe03b47f0a71dc92d26aa2859
Reviewed-on: https://gerrit.libreoffice.org/56199
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc/chgtrack.hxx')
-rw-r--r-- | sc/inc/chgtrack.hxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index d5b157184b1c..a23744c53a08 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -523,6 +523,7 @@ public: class ScChangeActionMove : public ScChangeAction { friend class ScChangeTrack; + friend struct std::default_delete<ScChangeActionMove>; // for std::unique_ptr friend class ScChangeActionDel; ScBigRange aFromRange; @@ -870,7 +871,7 @@ class ScChangeTrack : public utl::ConfigurationListener ScChangeAction* pLast; ScChangeActionContent* pFirstGeneratedDelContent; std::unique_ptr<ScChangeActionContent*[]> ppContentSlots; - ScChangeActionMove* pLastCutMove; + std::unique_ptr<ScChangeActionMove> pLastCutMove; ScChangeActionLinkEntry* pLinkInsertCol; ScChangeActionLinkEntry* pLinkInsertRow; ScChangeActionLinkEntry* pLinkInsertTab; @@ -1084,11 +1085,7 @@ public: void ResetLastCut() { nStartLastCut = nEndLastCut = 0; - if ( pLastCutMove ) - { - delete pLastCutMove; - pLastCutMove = nullptr; - } + pLastCutMove.reset(); } bool HasLastCut() const { |