summaryrefslogtreecommitdiffstats
path: root/i18npool/source/search
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-16 14:15:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 08:34:42 +0000
commit7a60e90ef05c84923f83882efc01c33fef1ed305 (patch)
tree4c49f1ab14fda2a79e0d8efdb731d4d6fe924eba /i18npool/source/search
parenttdf#35021 TabOverMargin: support center and decimal tabs also (diff)
downloadcore-7a60e90ef05c84923f83882efc01c33fef1ed305.tar.gz
core-7a60e90ef05c84923f83882efc01c33fef1ed305.zip
new loplugin: useuniqueptr: helpcompiler..io
Change-Id: I6b394163c144e6b5540cb160abb613d56fe327de Reviewed-on: https://gerrit.libreoffice.org/33165 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/search')
-rw-r--r--i18npool/source/search/levdis.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/i18npool/source/search/levdis.hxx b/i18npool/source/search/levdis.hxx
index cd12628686ca..4d834bdb685c 100644
--- a/i18npool/source/search/levdis.hxx
+++ b/i18npool/source/search/levdis.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_I18NPOOL_SOURCE_SEARCH_LEVDIS_HXX
#include <rtl/ustring.hxx>
+#include <memory>
// Sensible default values for a user interface could be:
// LEVDISDEFAULT_XOTHER 2
@@ -115,19 +116,18 @@ public:
class WLevDisDistanceMem
{
- int* p;
+ std::unique_ptr<int[]> p;
public:
explicit WLevDisDistanceMem( size_t s )
- : p(nullptr)
{
NewMem(s);
}
- ~WLevDisDistanceMem() { delete [] p; }
- int* GetPtr() const { return p; }
+ ~WLevDisDistanceMem() {}
+ int* GetPtr() const { return p.get(); }
int* NewMem( size_t s )
{
- delete [] p;
- return (p = new int[ s<3 ? 3 : s ]);
+ p.reset(new int[ s<3 ? 3 : s ]);
+ return p.get();
}
};