pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] r3971 - trunk/pingus/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3971 - trunk/pingus/src
Date: Thu, 26 Feb 2009 12:17:25 +0100

Author: grumbel
Date: 2009-02-26 12:17:25 +0100 (Thu, 26 Feb 2009)
New Revision: 3971

Modified:
   trunk/pingus/src/string_format.cpp
Log:
Renamed length -> width

Modified: trunk/pingus/src/string_format.cpp
===================================================================
--- trunk/pingus/src/string_format.cpp  2009-02-26 11:11:00 UTC (rev 3970)
+++ trunk/pingus/src/string_format.cpp  2009-02-26 11:17:25 UTC (rev 3971)
@@ -19,7 +19,7 @@
 
 
 std::string
-StringFormat::break_line (std::string text, int length, const Font& font)
+StringFormat::break_line (std::string text, int width, const Font& font)
 {
   std::string::size_type pos = 0;
   while ((pos = text.find('\t', pos)) != std::string::npos)
@@ -65,18 +65,18 @@
 
   while ((pos = text.find(' ', pos + 1)) != std::string::npos)
     {
-      if (font.get_width(text.substr(start_pos, pos - start_pos)) > length)
+      if (font.get_width(text.substr(start_pos, pos - start_pos)) > width)
         {
          text[previous_space] = '\n';
          start_pos = previous_space + 1;
        }
-      else if (font.get_width(text.substr(start_pos, text.length())) <= length)
+      else if (font.get_width(text.substr(start_pos, text.length())) <= width)
         break;
 
       previous_space = pos;
     }
 
-  if (font.get_width(text.substr(start_pos, text.length() - start_pos)) > 
length)
+  if (font.get_width(text.substr(start_pos, text.length() - start_pos)) > 
width)
     text[text.rfind(' ')] = '\n';
 
   return text;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]