From a14f5340b58421aa8a107deca0eefabe5de5d3fd Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 15 Nov 2019 09:25:29 +1100 Subject: Backport: Feature [feature-requests:#1316] Allow target to have virtual space. Backport of changeset 7768:5d73aa55a6ee. --- gtk/ScintillaGTK.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 8ed9ea1ce..42a15acd5 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -756,16 +756,16 @@ std::string ConvertText(const char *s, size_t len, const char *charSetDest, // Returns the target converted to UTF8. // Return the length in bytes. Sci::Position ScintillaGTK::TargetAsUTF8(char *text) const { - const Sci::Position targetLength = targetEnd - targetStart; + const Sci::Position targetLength = targetRange.Length(); if (IsUnicodeMode()) { if (text) { - pdoc->GetCharRange(text, targetStart, targetLength); + pdoc->GetCharRange(text, targetRange.start.Position(), targetLength); } } else { // Need to convert const char *charSetBuffer = CharacterSetID(); if (*charSetBuffer) { - std::string s = RangeText(targetStart, targetEnd); + std::string s = RangeText(targetRange.start.Position(), targetRange.end.Position()); std::string tmputf = ConvertText(&s[0], targetLength, "UTF-8", charSetBuffer, false); if (text) { memcpy(text, tmputf.c_str(), tmputf.length()); @@ -773,7 +773,7 @@ Sci::Position ScintillaGTK::TargetAsUTF8(char *text) const { return tmputf.length(); } else { if (text) { - pdoc->GetCharRange(text, targetStart, targetLength); + pdoc->GetCharRange(text, targetRange.start.Position(), targetLength); } } } -- cgit v1.2.3