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

Mike Kaganski mike.kaganski at collabora.com
Sun Dec 17 03:57:30 UTC 2017


 cui/source/tabpages/numpages.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit ccb6a1c6d59859467f9d9a6d954501e9329ee202
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sat Dec 16 21:21:37 2017 +0200

    loplugin:unusedindex Remove useless outer loop
    
    Change-Id: I6e5e7162b1e0ea2b9f33866ea76e2614acdffb06
    Reviewed-on: https://gerrit.libreoffice.org/46606
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index a6e69c4d023b..c8cded8ce25d 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1718,19 +1718,16 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer *, void)
 
 IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, Edit&, rBox, void )
 {
-    for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
+    sal_uInt16 nMask = 1;
+    for(sal_uInt16 e = 0; e < pActNum->GetLevelCount(); e++)
     {
-        sal_uInt16 nMask = 1;
-        for(sal_uInt16 e = 0; e < pActNum->GetLevelCount(); e++)
+        if(nActNumLvl & nMask)
         {
-            if(nActNumLvl & nMask)
-            {
-                SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
-                aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1)) );
-                pActNum->SetLevel(e, aNumFmt);
-            }
-            nMask <<= 1;
+            SvxNumberFormat aNumFmt(pActNum->GetLevel(e));
+            aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(static_cast<NumericField&>(rBox).GetValue(), sal_Int64(e + 1)) );
+            pActNum->SetLevel(e, aNumFmt);
         }
+        nMask <<= 1;
     }
     SetModified();
 }


More information about the Libreoffice-commits mailing list