summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-04-06 16:59:34 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-04-06 16:59:34 +0200
commit26fb00ec6d8dec52a4ec4c0f194a9da6f310b7e3 (patch)
tree68a45ebbc317f2022996e0d6c23245430503b224 /i18npool
parent032aee2cb74e168ecf35ef698a84165cc74fad0a (diff)
loplugin:useuniqueptr
Change-Id: I1499ea7316811892c014592ef2bb6e431543af1a
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/collator/gencoll_rule.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 7ca3e935e5f2..7d795b5af079 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -27,6 +27,7 @@
#include <sal/main.h>
#include <sal/types.h>
#include <rtl/ustrbuf.hxx>
+#include <o3tl/make_unique.hxx>
#include <unicode/tblcoll.h>
@@ -112,7 +113,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
//UCollator *coll = ucol_openRules(Obuf.getStr(), Obuf.getLength(), UCOL_OFF,
// UCOL_DEFAULT_STRENGTH, &parseError, &status);
- RuleBasedCollator *coll = new RuleBasedCollator(reinterpret_cast<const UChar *>(Obuf.getStr()), status);
+ auto coll = o3tl::make_unique<RuleBasedCollator>(reinterpret_cast<const UChar *>(Obuf.getStr()), status);
if (U_SUCCESS(status)) {
std::vector<uint8_t> data;
@@ -131,8 +132,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
printf("\nRule parsing error\n");
}
- delete coll;
-
return U_SUCCESS(status) ? 0 : 1;
} // End of main