diff options
author | Ira Rice <irarice@gmail.com> | 2008-11-05 16:58:14 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-11-05 16:58:14 +0000 |
commit | 8828593b7976e48804c132bd249e15d096b3103f (patch) | |
tree | 7ffbf20b13042938507c76ab052b01c1cfe91137 /src/gui/textbox.cpp | |
parent | 5c7340cf1e87745129e121309f0cdcb1f2e28b4b (diff) | |
download | mana-client-8828593b7976e48804c132bd249e15d096b3103f.tar.gz mana-client-8828593b7976e48804c132bd249e15d096b3103f.tar.bz2 mana-client-8828593b7976e48804c132bd249e15d096b3103f.tar.xz mana-client-8828593b7976e48804c132bd249e15d096b3103f.zip |
Found a way to remove the ugly hack that was done to ensure that
stringstream would behave. Before, it set the string stream to a single
space, while now it clears the stream and then sets it to null. So,
should the string stream code ever be fixed in the future, this function
won't break.
Diffstat (limited to 'src/gui/textbox.cpp')
-rw-r--r-- | src/gui/textbox.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp index 3507273a..2a496a1f 100644 --- a/src/gui/textbox.cpp +++ b/src/gui/textbox.cpp @@ -97,13 +97,8 @@ void TextBox::setTextWrapped(const std::string &text) if (minWidth > mMinWidth) { mMinWidth = minWidth; - // This is a reaaaly ugly hack for getting the string stream - // to clear itself. Don't mess with the spacer in the stream - // reset, as well as removing the break. These are all there - // because there are several compilers that I have tried - // that do not properly reset the string stream. - // You have been warned! - wrappedStream.str(" "); + wrappedStream.clear(); + wrappedStream.str(""); spacePos = 0; lastNewlinePos = 0; newlinePos = text.find("\n", lastNewlinePos); |