[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kate/part
From:       Christoph Cullmann <crossfire () babylon2k ! de>
Date:       2003-10-22 22:46:56
[Download RAW message or body]

CVS commit by cullmann: 

cleanup


  M +5 -10     katetextline.cpp   1.70


--- kdelibs/kate/part/katetextline.cpp  #1.69:1.70
@@ -163,5 +163,4 @@ uint TextLine::indentDepth (uint tabwidt
 {
   uint d = 0;
-  static QChar t ('\t');
 
   for(uint i = 0; i < m_text.length(); i++)
@@ -169,9 +168,6 @@ uint TextLine::indentDepth (uint tabwidt
     if(m_text[i].isSpace())
     {
-      if (m_text[i] == t)
-      {
-        d += tabwidth;
-        d -= d % tabwidth;
-      }
+      if (m_text[i] == QChar('\t'))
+        d += tabwidth - (d % tabwidth);
       else
         d++;
@@ -201,8 +197,7 @@ bool TextLine::endingWith(const QString&
 int TextLine::cursorX(uint pos, uint tabChars) const
 {
-  uint l = kMin (pos, m_text.length());
   uint x = 0;
 
-  for (uint z = 0; z < l; z++)
+  for (uint z = 0; z < kMin (pos, m_text.length()); z++)
   {
     if (m_text[z] == QChar('\t'))
@@ -212,5 +207,5 @@ int TextLine::cursorX(uint pos, uint tab
   }
 
-  return x + pos - l;
+  return x;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic