mail[Wesnoth-commits] r13726 - in /branches/1.2/src: marked-up_text.cpp serialization/string_utils.cpp serialization/string_utils.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edb on September 28, 2006 - 12:50:
Author: edb
Date: Thu Sep 28 12:49:42 2006
New Revision: 13726

URL: http://svn.gna.org/viewcvs/wesnoth?rev=13726&view=rev
Log:
don't handle format char at end.
fix https://gna.org/bugs/?7197

Modified:
    branches/1.2/src/marked-up_text.cpp
    branches/1.2/src/serialization/string_utils.cpp
    branches/1.2/src/serialization/string_utils.hpp

Modified: branches/1.2/src/marked-up_text.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/marked-up_text.cpp?rev=13726&r1=13725&r2=13726&view=diff
==============================================================================
--- branches/1.2/src/marked-up_text.cpp (original)
+++ branches/1.2/src/marked-up_text.cpp Thu Sep 28 12:49:42 2006
@@ -317,7 +317,7 @@
                if(start_of_line) {
                        line_width = 0;
                        format_string = "";
-                       while(ch != end && *ch < (wchar_t)0x100 && 
is_format_char(*ch)) {
+                       while(ch != end && *ch < (wchar_t)0x100 && 
is_format_char(*ch) && !ch.next_is_end()) {
                                format_string.append(ch.substr().first, 
ch.substr().second);
                                ++ch;
                        }

Modified: branches/1.2/src/serialization/string_utils.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/serialization/string_utils.cpp?rev=13726&r1=13725&r2=13726&view=diff
==============================================================================
--- branches/1.2/src/serialization/string_utils.cpp (original)
+++ branches/1.2/src/serialization/string_utils.cpp Thu Sep 28 12:49:42 2006
@@ -435,6 +435,13 @@
 wchar_t utf8_iterator::operator*() const
 {
        return current_char;
+}
+
+bool utf8_iterator::next_is_end()
+{
+       if(current_substr.second == string_end)
+               return true;
+       return false;
 }
 
 const std::pair<std::string::const_iterator, std::string::const_iterator>& 
utf8_iterator::substr() const

Modified: branches/1.2/src/serialization/string_utils.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/serialization/string_utils.hpp?rev=13726&r1=13725&r2=13726&view=diff
==============================================================================
--- branches/1.2/src/serialization/string_utils.hpp (original)
+++ branches/1.2/src/serialization/string_utils.hpp Thu Sep 28 12:49:42 2006
@@ -96,6 +96,7 @@
        bool operator!=(const utf8_iterator& a) const { return ! (*this == 
a); }
        utf8_iterator& operator++();
        wchar_t operator*() const;
+       bool next_is_end();
        const std::pair<std::string::const_iterator, 
std::string::const_iterator>& substr() const;
 private:
        void update();




Related Messages


Powered by MHonArc, Updated Thu Sep 28 14:20:13 2006