diff options
| author | nyamatongwe <unknown> | 2009-07-12 23:01:15 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2009-07-12 23:01:15 +0000 | 
| commit | 26c0795acabf1964ac9ba6dc7e212d58d9714c83 (patch) | |
| tree | 6a8eb71edc5b0f713eac8704ff7fb63b1cf00afc /src/Editor.cxx | |
| parent | ec9967718cd454c3966e968266e753ed069d51bd (diff) | |
| download | scintilla-mirror-26c0795acabf1964ac9ba6dc7e212d58d9714c83.tar.gz | |
Since exception handling now turned on, do not check return value from new.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 30 | 
1 files changed, 13 insertions, 17 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index ad9437a6a..6c6922648 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5271,12 +5271,10 @@ char *Editor::CopyRange(int start, int end) {  	if (start < end) {  		int len = end - start;  		text = new char[len + 1]; -		if (text) { -			for (int i = 0; i < len; i++) { -				text[i] = pdoc->CharAt(start + i); -			} -			text[len] = '\0'; +		for (int i = 0; i < len; i++) { +			text[i] = pdoc->CharAt(start + i);  		} +		text[len] = '\0';  	}  	return text;  } @@ -6198,19 +6196,17 @@ void Editor::AddStyledText(char *buffer, int appendLength) {  	// The buffer consists of alternating character bytes and style bytes  	size_t textLength = appendLength / 2;  	char *text = new char[textLength]; -	if (text) { -		size_t i; -		for (i = 0;i < textLength;i++) { -			text[i] = buffer[i*2]; -		} -		pdoc->InsertString(CurrentPosition(), text, textLength); -		for (i = 0;i < textLength;i++) { -			text[i] = buffer[i*2+1]; -		} -		pdoc->StartStyling(CurrentPosition(), static_cast<char>(0xff)); -		pdoc->SetStyles(textLength, text); -		delete []text; +	size_t i; +	for (i = 0;i < textLength;i++) { +		text[i] = buffer[i*2]; +	} +	pdoc->InsertString(CurrentPosition(), text, textLength); +	for (i = 0;i < textLength;i++) { +		text[i] = buffer[i*2+1];  	} +	pdoc->StartStyling(CurrentPosition(), static_cast<char>(0xff)); +	pdoc->SetStyles(textLength, text); +	delete []text;  	SetEmptySelection(sel.MainCaret() + textLength);  } | 
