diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-04-06 16:59:34 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-04-06 16:59:34 +0200 |
commit | 26fb00ec6d8dec52a4ec4c0f194a9da6f310b7e3 (patch) | |
tree | 68a45ebbc317f2022996e0d6c23245430503b224 | |
parent | 032aee2cb74e168ecf35ef698a84165cc74fad0a (diff) |
loplugin:useuniqueptr
Change-Id: I1499ea7316811892c014592ef2bb6e431543af1a
-rw-r--r-- | i18npool/source/collator/gencoll_rule.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 5 |
2 files changed, 5 insertions, 5 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 diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index ef742edc5478..7d4720bbbad7 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -37,6 +37,7 @@ #include <vcl/virdev.hxx> #include <vcl/waitobj.hxx> #include <vcl/wrkwin.hxx> +#include <o3tl/make_unique.hxx> #include <stdlib.h> #include "viewfunc.hxx" @@ -2663,9 +2664,9 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol, ScRangeName* pList = rDoc.GetRangeName(); ScRangeData::Type nType = ScRangeData::Type::Name; - std::unique_ptr<ScRangeData> pNewEntry(new ScRangeData( + auto pNewEntry = o3tl::make_unique<ScRangeData>( &rDoc, rName, rSymbol, ScAddress( GetViewData().GetCurX(), - GetViewData().GetCurY(), nTab), nType )); + GetViewData().GetCurY(), nTab), nType ); OUString aUpType = rType.toAsciiUpperCase(); if ( aUpType.indexOf( 'P' ) != -1 ) nType |= ScRangeData::Type::PrintArea; |