diff options
| author | nyamatongwe <unknown> | 2012-05-05 14:00:01 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2012-05-05 14:00:01 +1000 | 
| commit | ce8066a5ce92e6fcd5592e5a7ab4ed7cab59a4ad (patch) | |
| tree | ca7542892c069c6748ace5b2d7f4a6db10b83aae /src/Editor.cxx | |
| parent | af0b10fdaa1ba81f03a1dc51a59f6256f10cc68f (diff) | |
| download | scintilla-mirror-ce8066a5ce92e6fcd5592e5a7ab4ed7cab59a4ad.tar.gz | |
Replace std::auto_ptr with own code as has been deprecated by C++11.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 2fb2ea03f..3d5257059 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5800,6 +5800,19 @@ void Editor::SearchAnchor() {  	searchAnchor = SelectionStart().Position();  } +// Simple RAII wrapper for CaseFolder as std::auto_ptr is now deprecated +class ScopedCaseFolder { +	CaseFolder *pcf; +public: +	ScopedCaseFolder(CaseFolder *pcf_) : pcf(pcf_) { +	} +	~ScopedCaseFolder() { +		delete pcf; +		pcf = 0; +	} +	CaseFolder *get() const { return pcf; } +}; +  /**   * Find text from current search anchor: Must call @c SearchAnchor first.   * Used for next text and previous text requests. @@ -5814,7 +5827,7 @@ long Editor::SearchText(  	const char *txt = reinterpret_cast<char *>(lParam);  	int pos;  	int lengthFound = istrlen(txt); -	std::auto_ptr<CaseFolder> pcf(CaseFolderForEncoding()); +	ScopedCaseFolder pcf(CaseFolderForEncoding());  	if (iMessage == SCI_SEARCHNEXT) {  		pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt,  		        (wParam & SCFIND_MATCHCASE) != 0, @@ -5865,7 +5878,7 @@ std::string Editor::CaseMapString(const std::string &s, int caseMapping) {  long Editor::SearchInTarget(const char *text, int length) {  	int lengthFound = length; -	std::auto_ptr<CaseFolder> pcf(CaseFolderForEncoding()); +	ScopedCaseFolder pcf(CaseFolderForEncoding());  	int pos = pdoc->FindText(targetStart, targetEnd, text,  	        (searchFlags & SCFIND_MATCHCASE) != 0,  	        (searchFlags & SCFIND_WHOLEWORD) != 0, | 
