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

Michael Weghorn (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 13 14:28:39 UTC 2021


 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |   20 +++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

New commits:
commit a74aeceda27879d2f441d21338e2a24a9a9957ee
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Mon Sep 13 11:36:08 2021 +0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Mon Sep 13 16:28:04 2021 +0200

    Drop unnecessary extra indentation
    
    There's no reason to introduce extra blocks here.
    
    Change-Id: Ie3e72e8535617865646bb8161890aebfbc0db4d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122027
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index c8b52475e47e..d5ec795c64d0 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -99,26 +99,22 @@ ScMyAddress ScAccessibleSpreadsheet::CalcScAddressFromRangeList(ScRangeList *pMa
         for(sal_Int32 row = nMinRow ; row <= nMaxRow ; ++row)
         {
             m_vecTempCol.clear();
+            for (ScRange const & r : m_vecTempRange)
             {
-                for (ScRange const & r : m_vecTempRange)
+                if ( row >= r.aStart.Row() && row <= r.aEnd.Row())
                 {
-                    if ( row >= r.aStart.Row() && row <= r.aEnd.Row())
-                    {
-                        m_vecTempCol.emplace_back(r.aStart.Col(),r.aEnd.Col());
-                    }
+                    m_vecTempCol.emplace_back(r.aStart.Col(),r.aEnd.Col());
                 }
             }
             std::sort(m_vecTempCol.begin(),m_vecTempCol.end(),CompMinCol);
+            for (const PAIR_COL &pairCol : m_vecTempCol)
             {
-                for(const PAIR_COL &pairCol : m_vecTempCol)
+                sal_uInt16 nCol = pairCol.second - pairCol.first + 1;
+                if (nCol + nCurrentIndex > nSelectedChildIndex)
                 {
-                    sal_uInt16 nCol = pairCol.second - pairCol.first + 1;
-                    if (nCol + nCurrentIndex > nSelectedChildIndex)
-                    {
-                        return ScMyAddress(static_cast<SCCOL>(pairCol.first + nSelectedChildIndex - nCurrentIndex), row, maActiveCell.Tab());
-                    }
-                    nCurrentIndex += nCol;
+                    return ScMyAddress(static_cast<SCCOL>(pairCol.first + nSelectedChildIndex - nCurrentIndex), row, maActiveCell.Tab());
                 }
+                nCurrentIndex += nCol;
             }
         }
     }


More information about the Libreoffice-commits mailing list