From 7a60e90ef05c84923f83882efc01c33fef1ed305 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 16 Jan 2017 14:15:13 +0200 Subject: new loplugin: useuniqueptr: helpcompiler..io Change-Id: I6b394163c144e6b5540cb160abb613d56fe327de Reviewed-on: https://gerrit.libreoffice.org/33165 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/source/indexentry/indexentrysupplier_common.cxx | 3 +-- i18npool/source/indexentry/indexentrysupplier_default.cxx | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'i18npool/source/indexentry') diff --git a/i18npool/source/indexentry/indexentrysupplier_common.cxx b/i18npool/source/indexentry/indexentrysupplier_common.cxx index fafb3046d5b2..ee5d0d1b08c8 100644 --- a/i18npool/source/indexentry/indexentrysupplier_common.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_common.cxx @@ -30,13 +30,12 @@ namespace com { namespace sun { namespace star { namespace i18n { IndexEntrySupplier_Common::IndexEntrySupplier_Common(const Reference < uno::XComponentContext >& rxContext) { implementationName = "com.sun.star.i18n.IndexEntrySupplier_Common"; - collator = new CollatorImpl(rxContext); + collator.reset( new CollatorImpl(rxContext) ); usePhonetic = false; } IndexEntrySupplier_Common::~IndexEntrySupplier_Common() { - delete collator; } Sequence < lang::Locale > SAL_CALL IndexEntrySupplier_Common::getLocaleList() throw (RuntimeException, std::exception) diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index 2c902cf002b7..8762e9e6c65d 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -32,12 +32,11 @@ IndexEntrySupplier_Unicode::IndexEntrySupplier_Unicode( IndexEntrySupplier_Common(rxContext) { implementationName = "com.sun.star.i18n.IndexEntrySupplier_Unicode"; - index = new Index(rxContext); + index.reset( new Index(rxContext) ); } IndexEntrySupplier_Unicode::~IndexEntrySupplier_Unicode() { - delete index; } sal_Bool SAL_CALL IndexEntrySupplier_Unicode::loadAlgorithm( const lang::Locale& rLocale, @@ -111,13 +110,12 @@ Index::Index(const css::uno::Reference < css::uno::XComponentContext >& rxContex : table_count(0) , key_count(0) , mkey_count(0) + , collator( new CollatorImpl(rxContext) ) { - collator = new CollatorImpl(rxContext); } Index::~Index() { - delete collator; } sal_Int16 Index::compare(sal_Unicode c1, sal_Unicode c2) -- cgit