diff options
| author | Neil <nyamatongwe@gmail.com> | 2021-03-18 19:50:34 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2021-03-18 19:50:34 +1100 |
| commit | 6af47b53d52c29474bfc551700f8394dbf1dbc04 (patch) | |
| tree | 12306e8c4586c60ebcc64acac5018b570b69605f /win32 | |
| parent | 402e089842d5aa2bb3774a665e26c42dc91fa5b4 (diff) | |
| download | scintilla-mirror-6af47b53d52c29474bfc551700f8394dbf1dbc04.tar.gz | |
Use unique_ptr for CaseFolderForEncoding to show transfer of ownership.
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/ScintillaWin.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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<CaseFolder> 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<CaseFolder> ScintillaWin::CaseFolderForEncoding() { const UINT cpDest = CodePageOfDocument(); if (cpDest == SC_CP_UTF8) { - return new CaseFolderUnicode(); + return std::make_unique<CaseFolderUnicode>(); } else { if (pdoc->dbcsCodePage == 0) { - CaseFolderTable *pcf = new CaseFolderTable(); + std::unique_ptr<CaseFolderTable> pcf = std::make_unique<CaseFolderTable>(); 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<CaseFolderDBCS>(cpDest); } } } |
