summaryrefslogtreecommitdiff
path: root/i18npool/source/collator/gencoll_rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/collator/gencoll_rule.cxx')
-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