From e5bf102b598a88c1c13e4f83264b652e85c75f22 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 25 Apr 2018 16:26:57 +1000 Subject: Backport: Standardized signature of TargetAsUTF8 and EncodedFromUTF8. Backport of changeset 6737:5c4aea8a1e8a. --- gtk/ScintillaGTK.cxx | 8 ++++---- gtk/ScintillaGTK.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index a8b34e01b..47975d2ed 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -741,8 +741,8 @@ std::string ConvertText(const char *s, size_t len, const char *charSetDest, // Returns the target converted to UTF8. // Return the length in bytes. -int ScintillaGTK::TargetAsUTF8(char *text) { - int targetLength = targetEnd - targetStart; +Sci::Position ScintillaGTK::TargetAsUTF8(char *text) const { + Sci::Position targetLength = targetEnd - targetStart; if (IsUnicodeMode()) { if (text) { pdoc->GetCharRange(text, targetStart, targetLength); @@ -768,8 +768,8 @@ int ScintillaGTK::TargetAsUTF8(char *text) { // Translates a nul terminated UTF8 string into the document encoding. // Return the length of the result in bytes. -int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) const { - int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); +Sci::Position ScintillaGTK::EncodedFromUTF8(const char *utf8, char *encoded) const { + Sci::Position inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) { memcpy(encoded, utf8, inputLength); diff --git a/gtk/ScintillaGTK.h b/gtk/ScintillaGTK.h index 07456a689..8a72b4002 100644 --- a/gtk/ScintillaGTK.h +++ b/gtk/ScintillaGTK.h @@ -85,8 +85,8 @@ private: void DisplayCursor(Window::Cursor c) override; bool DragThreshold(Point ptStart, Point ptNow) override; void StartDrag() override; - int TargetAsUTF8(char *text); - int EncodedFromUTF8(char *utf8, char *encoded) const; + Sci::Position TargetAsUTF8(char *text) const; + Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const; bool ValidCodePage(int codePage) const override; public: // Public for scintilla_send_message sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override; -- cgit v1.2.3