summaryrefslogtreecommitdiff
path: root/include/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-10 12:30:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 12:47:37 +0100
commite57a036939e27ecd173ace691689e26a6a33df8e (patch)
treea36d589da272c4732cddb4ca0548cdb5dcb2b2bd /include/unotools
parentcb5d79b504aa8575ea15c777707c7465ea43cb07 (diff)
loplugin:useuniqueptr in tools,stoc,unotools
Change-Id: Ia72b65577143623cedc7a40bc34f7fb897add097 Reviewed-on: https://gerrit.libreoffice.org/47726 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/unotools')
-rw-r--r--include/unotools/intlwrapper.hxx13
-rw-r--r--include/unotools/tempfile.hxx4
2 files changed, 10 insertions, 7 deletions
diff --git a/include/unotools/intlwrapper.hxx b/include/unotools/intlwrapper.hxx
index 8877a05dbd61..ffcb3313b349 100644
--- a/include/unotools/intlwrapper.hxx
+++ b/include/unotools/intlwrapper.hxx
@@ -27,6 +27,7 @@
#include <unotools/collatorwrapper.hxx>
#include <i18nlangtag/lang.h>
#include <i18nlangtag/languagetag.hxx>
+#include <memory>
/**
A wrapper of I18N wrappers. Using this is more expensive than using some
@@ -50,9 +51,9 @@ private:
LanguageTag maLanguageTag;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
- LocaleDataWrapper* pLocaleData;
- CollatorWrapper* pCollator;
- CollatorWrapper* pCaseCollator;
+ std::unique_ptr<LocaleDataWrapper> pLocaleData;
+ std::unique_ptr<CollatorWrapper> pCollator;
+ std::unique_ptr<CollatorWrapper> pCaseCollator;
void ImplNewLocaleData() const;
void ImplNewCollator( bool bCaseSensitive ) const;
@@ -65,21 +66,21 @@ public:
{
if ( !pLocaleData )
ImplNewLocaleData();
- return pLocaleData;
+ return pLocaleData.get();
}
/// case insensitive collator, simple IGNORE_CASE
const CollatorWrapper* getCollator() const
{
if ( !pCollator )
ImplNewCollator( false );
- return pCollator;
+ return pCollator.get();
}
/// case sensitive collator
const CollatorWrapper* getCaseCollator() const
{
if ( !pCaseCollator )
ImplNewCollator( true );
- return pCaseCollator;
+ return pCaseCollator.get();
}
};
diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx
index 791b51573f29..a70f7d277fbf 100644
--- a/include/unotools/tempfile.hxx
+++ b/include/unotools/tempfile.hxx
@@ -22,6 +22,7 @@
#include <unotools/unotoolsdllapi.h>
#include <tools/stream.hxx>
+#include <memory>
namespace utl
{
@@ -45,7 +46,8 @@ namespace utl
class UNOTOOLS_DLLPUBLIC TempFile
{
OUString aName;
- SvStream* pStream;
+ std::unique_ptr<SvStream>
+ pStream;
bool bIsDirectory;
bool bKillingFileEnabled;