From: <Kha...@us...> - 2010-01-28 11:56:15
|
Revision: 5398 http://planeshift.svn.sourceforge.net/planeshift/?rev=5398&view=rev Author: Khakilord Date: 2010-01-28 11:56:09 +0000 (Thu, 28 Jan 2010) Log Message: ----------- Fixed bug in rewinding code points. Modified Paths: -------------- trunk/src/common/paws/pawstextbox.cpp trunk/src/common/paws/pawstextbox.h Modified: trunk/src/common/paws/pawstextbox.cpp =================================================================== --- trunk/src/common/paws/pawstextbox.cpp 2010-01-28 04:19:55 UTC (rev 5397) +++ trunk/src/common/paws/pawstextbox.cpp 2010-01-28 11:56:09 UTC (rev 5398) @@ -346,7 +346,7 @@ return codePoints; } -const char* pawsTextBox::RewindCodePoints(const char* text, int start, int count) +int pawsTextBox::RewindCodePoints(const char* text, int start, int count) { const char* str = text + start; while(count > 0 && str > text) @@ -354,7 +354,7 @@ str -= csUnicodeTransform::UTF8Rewind((const utf8_char*) str, str - text); count--; } - return str; + return str - text; } const char* pawsTextBox::SkipCodePoints(const char* text, int start, int count) Modified: trunk/src/common/paws/pawstextbox.h =================================================================== --- trunk/src/common/paws/pawstextbox.h 2010-01-28 04:19:55 UTC (rev 5397) +++ trunk/src/common/paws/pawstextbox.h 2010-01-28 11:56:09 UTC (rev 5398) @@ -83,7 +83,7 @@ static int CountCodePoints(const char* text, int start = 0, int len = -1); // Utility function to rewind a UTF-8 string by a certain number of codepoints - static const char* RewindCodePoints(const char* text, int start, int count); + static int RewindCodePoints(const char* text, int start, int count); // Utility function to skip a UTF-8 string by a certain number of codepoints static const char* SkipCodePoints(const char* text, int start, int count); @@ -298,7 +298,7 @@ /// Position of first character that we display int start; - /// The position of the cursor blink + /// The position of the cursor blink (in code units not points) size_t cursorPosition; unsigned int cursorLine; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |