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 /win32/ScintillaWin.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 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 1699b769f..e8ad20ef8 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1375,9 +1375,7 @@ void ScintillaWin::Paste() { unsigned int bytes = memUSelection.Size(); len = UTF8Length(uptr, bytes / 2); putf = new char[len + 1]; - if (putf) { - UTF8FromUTF16(uptr, bytes / 2, putf, len); - } + UTF8FromUTF16(uptr, bytes / 2, putf, len); } else { // CF_UNICODETEXT available, but not in Unicode mode // Convert from Unicode to current Scintilla code page @@ -1386,16 +1384,12 @@ void ScintillaWin::Paste() { len = ::WideCharToMultiByte(cpDest, 0, uptr, -1, NULL, 0, NULL, NULL) - 1; // subtract 0 terminator putf = new char[len + 1]; - if (putf) { - ::WideCharToMultiByte(cpDest, 0, uptr, -1, + ::WideCharToMultiByte(cpDest, 0, uptr, -1, putf, len + 1, NULL, NULL); - } } - if (putf) { - InsertPasteText(putf, len, selStart, isRectangular, isLine); - delete []putf; - } + InsertPasteText(putf, len, selStart, isRectangular, isLine); + delete []putf; } memUSelection.Unlock(); } else { @@ -2209,10 +2203,8 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, // Convert UTF-16 to UTF-8 int dataLen = UTF8Length(udata, tlen/2); data = new char[dataLen+1]; - if (data) { - UTF8FromUTF16(udata, tlen/2, data, dataLen); - dataAllocated = true; - } + UTF8FromUTF16(udata, tlen/2, data, dataLen); + dataAllocated = true; } else { // Convert UTF-16 to ANSI // @@ -2224,12 +2216,10 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState, int tlen = ::WideCharToMultiByte(cpDest, 0, udata, -1, NULL, 0, NULL, NULL) - 1; // subtract 0 terminator data = new char[tlen + 1]; - if (data) { - memset(data, 0, (tlen+1)); - ::WideCharToMultiByte(cpDest, 0, udata, -1, - data, tlen + 1, NULL, NULL); - dataAllocated = true; - } + memset(data, 0, (tlen+1)); + ::WideCharToMultiByte(cpDest, 0, udata, -1, + data, tlen + 1, NULL, NULL); + dataAllocated = true; } } |