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

List:       kde-commits
Subject:    KOFFICE_1_3_BRANCH: koffice/lib/kotext
From:       David Faure <faure () kde ! org>
Date:       2004-07-12 23:03:44
Message-ID: 20040712230344.54E3116B0D () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Fixed numbering with missing parent paragraphs (backport)


  M +6 -5      koparagcounter.cc   1.38.2.1


--- koffice/lib/kotext/koparagcounter.cc  #1.38:1.38.2.1
@@ -534,16 +534,17 @@ QString KoParagCounter::text( const KoTe
                         str[i] = ' ';
 
-                //kdDebug() << "levelText = " << str << endl;
+                str.append('.'); // hardcoded on purpose (like OO) until anyone complains
+
                 // Find the number of missing parents, and add dummy text for them.
                 int missingParents = m_depth - level - p->counter()->m_depth;
+                //kdDebug() << "levelText = " << str << " missingParents=" << missingParents << endl;
+                level += missingParents;
                 for ( ; missingParents > 0 ; --missingParents )
                     // Each missing level adds a "0"
-                    str.append('0' );
-
-                str.append('.'); // hardcoded on purpose (like OO) until anyone complains
+                    str.append( "0." );
 
                 m_cache.text.prepend( str );
                 // Prepare next iteration
-                if ( level < m_displayLevels ) // no need to calc it if we won't use it
+                if ( level < displayLevels ) // no need to calc it if we won't use it
                     p = counter->parent( p );
             }


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

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