From 6af47b53d52c29474bfc551700f8394dbf1dbc04 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 18 Mar 2021 19:50:34 +1100 Subject: Use unique_ptr for CaseFolderForEncoding to show transfer of ownership. --- win32/ScintillaWin.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 6693ffb7c..d96199170 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -428,7 +428,7 @@ class ScintillaWin : int GetCtrlID() override; void NotifyParent(SCNotification scn) override; void NotifyDoubleClick(Point pt, int modifiers) override; - CaseFolder *CaseFolderForEncoding() override; + std::unique_ptr CaseFolderForEncoding() override; std::string CaseMapString(const std::string &s, int caseMapping) override; void Copy() override; bool CanPaste() override; @@ -2356,13 +2356,13 @@ public: } }; -CaseFolder *ScintillaWin::CaseFolderForEncoding() { +std::unique_ptr ScintillaWin::CaseFolderForEncoding() { const UINT cpDest = CodePageOfDocument(); if (cpDest == SC_CP_UTF8) { - return new CaseFolderUnicode(); + return std::make_unique(); } else { if (pdoc->dbcsCodePage == 0) { - CaseFolderTable *pcf = new CaseFolderTable(); + std::unique_ptr pcf = std::make_unique(); pcf->StandardASCII(); // Only for single byte encodings for (int i=0x80; i<0x100; i++) { @@ -2391,7 +2391,7 @@ CaseFolder *ScintillaWin::CaseFolderForEncoding() { } return pcf; } else { - return new CaseFolderDBCS(cpDest); + return std::make_unique(cpDest); } } } -- cgit v1.2.3