From 4a8cb6d15e3f84f3197eca412a3ae8072b80b362 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 30 Jun 2012 15:41:18 +0000 Subject: [PATCH] [BUG_FIXED] (Author: Andreas Jonsson) Fix lower/UPPER case on selected text which contains NULL characters. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@922 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index ac40f7824..0caa288f9 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -2403,7 +2403,9 @@ void ScintillaEditView::convertSelectedTextTo(bool Case) } ::WideCharToMultiByte(codepage, 0, selectedStrW, strWSize, selectedStr, strSize, NULL, NULL); - execute(SCI_REPLACESEL, strSize, (LPARAM)selectedStr); + execute(SCI_SETTARGETSTART, selectionStart); + execute(SCI_SETTARGETEND, selectionEnd); + execute(SCI_REPLACETARGET, strSize - 1, (LPARAM)selectedStr); execute(SCI_SETSEL, selectionStart, selectionEnd); delete [] selectedStr; delete [] selectedStrW;