diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-29 08:15:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-29 09:35:30 +0200 |
commit | 497e40ad03c27837978551ba15491c3fb2a0bf53 (patch) | |
tree | baa53156ae5234b65f645e11e590c64e569c6284 /i18npool | |
parent | 71112060e0930fc58087c3762e836b1e12b60f75 (diff) |
improve refcounting loplugin
to find ref-counted classes being managed via other smart pointer
classes.
Hopefully prevent needing fixes like
642ae256ea5b8083ba0b3c097ca8ea52304b9cdb
"ChangedUIEventListener is refcounted, mustn't be helt by unique_ptr"
Change-Id: I6b0c5f8f87ce3546a8a1104ce1000470c09459bd
Reviewed-on: https://gerrit.libreoffice.org/39378
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
5 files changed, 8 insertions, 6 deletions
diff --git a/i18npool/inc/defaultnumberingprovider.hxx b/i18npool/inc/defaultnumberingprovider.hxx index 0fe3ae4b6a5e..d487ec1c4914 100644 --- a/i18npool/inc/defaultnumberingprovider.hxx +++ b/i18npool/inc/defaultnumberingprovider.hxx @@ -23,9 +23,10 @@ #include <com/sun/star/text/XNumberingFormatter.hpp> #include <com/sun/star/text/XNumberingTypeInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <cppuhelper/implbase.hxx> #include <com/sun/star/i18n/XTransliteration.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> +#include <cppuhelper/implbase.hxx> +#include <rtl/ref.hxx> #include <transliterationImpl.hxx> @@ -74,7 +75,7 @@ public: private: css::uno::Reference < css::uno::XComponentContext > m_xContext; css::uno::Reference < css::container::XHierarchicalNameAccess > xHierarchicalNameAccess; - std::unique_ptr<TransliterationImpl> translit; + rtl::Reference<TransliterationImpl> translit; /// @throws css::uno::RuntimeException OUString SAL_CALL makeNumberingIdentifier( sal_Int16 index ); /// @throws css::uno::RuntimeException diff --git a/i18npool/inc/indexentrysupplier_common.hxx b/i18npool/inc/indexentrysupplier_common.hxx index 74983cb3708d..bdd042fe779b 100644 --- a/i18npool/inc/indexentrysupplier_common.hxx +++ b/i18npool/inc/indexentrysupplier_common.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp> #include <cppuhelper/implbase.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <rtl/ref.hxx> #include <collatorImpl.hxx> #include <memory> @@ -80,7 +81,7 @@ public: protected: const sal_Char * implementationName; bool usePhonetic; - std::unique_ptr<CollatorImpl> + rtl::Reference<CollatorImpl> collator; css::lang::Locale aLocale; OUString aAlgorithm; diff --git a/i18npool/inc/indexentrysupplier_default.hxx b/i18npool/inc/indexentrysupplier_default.hxx index e2a6be7fe7f7..0de94706ac2f 100644 --- a/i18npool/inc/indexentrysupplier_default.hxx +++ b/i18npool/inc/indexentrysupplier_default.hxx @@ -97,7 +97,7 @@ public: sal_Int16 mkeys[MAX_KEYS]; sal_Int16 mkey_count; OUString skipping_chars; - std::unique_ptr<CollatorImpl> collator; + rtl::Reference<CollatorImpl> collator; sal_Int16 compare(sal_Unicode c1, sal_Unicode c2); }; diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index cab75e6f32ac..42abd7bbbf48 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -647,7 +647,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal OUString transliteration; getPropertyByName(aProperties, "Transliteration", true) >>= transliteration; if ( !translit ) - translit.reset( new TransliterationImpl(m_xContext) ); + translit = new TransliterationImpl(m_xContext); translit->loadModuleByImplName(transliteration, aLocale); result += translit->transliterateString2String(tmp, 0, tmp.getLength()); } catch (Exception& ) { diff --git a/i18npool/source/indexentry/indexentrysupplier_common.cxx b/i18npool/source/indexentry/indexentrysupplier_common.cxx index 77135523966a..ba7aa0fccfb4 100644 --- a/i18npool/source/indexentry/indexentrysupplier_common.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_common.cxx @@ -30,7 +30,7 @@ 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.reset( new CollatorImpl(rxContext) ); + collator = new CollatorImpl(rxContext); usePhonetic = false; } |