summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i18npool/source/collator/gencoll_rule.cxx5
-rw-r--r--sc/source/ui/view/viewfunc.cxx5
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;