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 /qt/ScintillaEditBase/ScintillaQt.cpp | |
parent | 402e089842d5aa2bb3774a665e26c42dc91fa5b4 (diff) | |
download | scintilla-mirror-6af47b53d52c29474bfc551700f8394dbf1dbc04.tar.gz |
Use unique_ptr for CaseFolderForEncoding to show transfer of ownership.
Diffstat (limited to 'qt/ScintillaEditBase/ScintillaQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index 707862416..374027bd0 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -557,15 +557,15 @@ public: } }; -CaseFolder *ScintillaQt::CaseFolderForEncoding() +std::unique_ptr<CaseFolder> ScintillaQt::CaseFolderForEncoding() { if (pdoc->dbcsCodePage == SC_CP_UTF8) { - return new CaseFolderUnicode(); + return std::make_unique<CaseFolderUnicode>(); } else { const char *charSetBuffer = CharacterSetIDOfDocument(); if (charSetBuffer) { if (pdoc->dbcsCodePage == 0) { - CaseFolderTable *pcf = new CaseFolderTable(); + std::unique_ptr<CaseFolderTable> pcf = std::make_unique<CaseFolderTable>(); pcf->StandardASCII(); QTextCodec *codec = QTextCodec::codecForName(charSetBuffer); // Only for single byte encodings @@ -583,7 +583,7 @@ CaseFolder *ScintillaQt::CaseFolderForEncoding() } return pcf; } else { - return new CaseFolderDBCS(QTextCodec::codecForName(charSetBuffer)); + return std::make_unique<CaseFolderDBCS>(QTextCodec::codecForName(charSetBuffer)); } } return nullptr; |