parent
1efa0c0ece
commit
b7be47d0ba
3 changed files with 9 additions and 1 deletions
|
@ -317,7 +317,7 @@ std::string word_wrap_text(const std::string& unwrapped_text, int font_size, int
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -437,6 +437,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
|
||||
{
|
||||
return current_substr;
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue