From 0a2883b61472c5dbcd419d033bd8792c335dc175 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 29 Jan 2009 00:43:16 -0700 Subject: Removed useless check from the last commit. Signed-off-by: Ira Rice --- src/gui/textbox.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gui/textbox.cpp') diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp index c04b4262..e7986244 100644 --- a/src/gui/textbox.cpp +++ b/src/gui/textbox.cpp @@ -66,11 +66,8 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension) xpos = 0; spacePos = text.rfind(" ", text.size()); - if (spacePos == std::string::npos) - { - spacePos = 0; - } - else + + if (spacePos != std::string::npos) { const std::string word = text.substr(spacePos + 1); const int length = getFont()->getWidth(word); @@ -78,6 +75,7 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension) if (length > mMinWidth) mMinWidth = length; } + do { spacePos = line.find(" ", lastSpacePos); -- cgit v1.2.3-70-g09d2