From 74688b8b08b5e8533cd758b34dc3d3929da8ea34 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 3 Apr 2010 09:09:33 +0000 Subject: NUL characters in text formats on clipboard terminate the text. This is a reversion to 2.03 behaviour because of other applications using large clipboard allocations for small pieces of text. --- win32/ScintillaWin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index a14b8d01b..75957d073 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1567,10 +1567,10 @@ void ScintillaWin::Paste() { // CF_UNICODETEXT available, but not in Unicode mode // Convert from Unicode to current Scintilla code page UINT cpDest = CodePageOfDocument(); - len = ::WideCharToMultiByte(cpDest, 0, uptr, memUSelection.Size() / 2, + len = ::WideCharToMultiByte(cpDest, 0, uptr, -1, NULL, 0, NULL, NULL) - 1; // subtract 0 terminator putf = new char[len + 1]; - ::WideCharToMultiByte(cpDest, 0, uptr, memUSelection.Size() / 2, + ::WideCharToMultiByte(cpDest, 0, uptr, -1, putf, len + 1, NULL, NULL); } -- cgit v1.2.3