From 5ebd653f630d2f37c696f7f6928de4fa133b8486 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 11 Jun 2020 16:22:59 +1000 Subject: Backport: Fix bug on Win32 where calling WM_GETTEXT for more text than in document could return less text than in document. Backport of changeset 8302:2faf8ba9d1fb. --- win32/ScintillaWin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 668a450a8..83d83daae 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1327,7 +1327,7 @@ sptr_t ScintillaWin::GetText(uptr_t wParam, sptr_t lParam) { Sci::Position sizeRequestedRange = pdoc->GetRelativePositionUTF16(0, lengthWanted); if (sizeRequestedRange < 0) { // Requested more text than there is in the document. - sizeRequestedRange = pdoc->CountUTF16(0, pdoc->Length()); + sizeRequestedRange = pdoc->Length(); } std::string docBytes(sizeRequestedRange, '\0'); pdoc->GetCharRange(&docBytes[0], 0, sizeRequestedRange); -- cgit v1.2.3