diff options
author | nyamatongwe <devnull@localhost> | 2009-07-12 23:01:15 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-07-12 23:01:15 +0000 |
commit | da74fac3e81338d08b8b0c196b92bc298be9673e (patch) | |
tree | 6a8eb71edc5b0f713eac8704ff7fb63b1cf00afc /src/Editor.cxx | |
parent | e88520dcbd24f2bcbf6ebe9d49cb2370b9ce8cd1 (diff) | |
download | scintilla-mirror-da74fac3e81338d08b8b0c196b92bc298be9673e.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); } |