From bcdb1bd4f62e10f62c5627df70bf2b55fb01460e Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 21 Aug 2009 03:24:19 +0000 Subject: Not reporting an extra byte needed to store selection text. Fixed implicit line copy case to match stream copy. --- src/Editor.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 4df7c9247..9f50e331d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5330,7 +5330,7 @@ void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) { strncat(textWithEndl, "\r", textLen); if (pdoc->eolMode != SC_EOL_CR) strncat(textWithEndl, "\n", textLen); - ss->Set(textWithEndl, strlen(textWithEndl), + ss->Set(textWithEndl, strlen(textWithEndl) + 1, pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true); delete []text; } @@ -6465,7 +6465,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { SelectionText selectedText; CopySelectionRange(&selectedText); if (lParam == 0) { - return selectedText.len + 1; + return selectedText.len ? selectedText.len : 1; } else { char *ptr = CharPtrFromSPtr(lParam); int iChar = 0; -- cgit v1.2.3