[Libreoffice-commits] core.git: sw/source

Matteo Casalin matteo.casalin at yahoo.com
Sat Feb 23 13:56:25 PST 2013


 sw/source/core/txtnode/ndtxt.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 09a015e64e0433652beaca2d5294162c20d97a8b
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Feb 23 22:55:15 2013 +0100

    Slight simplification of loop
    
    Change-Id: I8eccb85962c07933d0bc5771067d3c533933e90b

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9c271c2..421d09e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2946,15 +2946,13 @@ XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
         }
     }
 
-    if ( bWithSpacesForLevel && GetActualListLevel() > 0 )
+    if (bWithSpacesForLevel)
     {
-        int nLevel( GetActualListLevel() );
-        while ( nLevel > 0 )
+        const sal_Unicode aSpace = ' ';
+        for (int nLevel = GetActualListLevel(); nLevel > 0; --nLevel)
         {
-            const sal_Unicode aSpace = ' ';
             aTxt.Insert( aSpace , 0 );
             aTxt.Insert( aSpace , 0 );
-            --nLevel;
         }
     }
 


More information about the Libreoffice-commits mailing list