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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 19 20:05:50 UTC 2021


 sfx2/source/sidebar/DeckLayouter.cxx |   26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

New commits:
commit bd7e258bac69f3b9f9e87128aacb989d23e24d4f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Mar 19 14:35:03 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Mar 19 21:05:10 2021 +0100

    cid#1473847 Logically dead code
    
    Change-Id: Id8973910097844602f00bdc491656ea6c983413e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112751
    Tested-by: Jenkins
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx
index 36d6357ef305..3752e7df8fe4 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -192,16 +192,21 @@ void LayoutPanels (
     //   size:
     //   Use the unmodified preferred height for all panels.
 
-    LayoutMode eMode (MinimumOrLarger);
+    LayoutMode eMode(MinimumOrLarger);
     if (bShowVerticalScrollBar)
+    {
         eMode = Preferred;
-    else if (nTotalPreferredHeight <= nAvailableHeight)
-        eMode = PreferredOrLarger;
-    else
-        eMode = MinimumOrLarger;
 
-    if (eMode != Preferred)
+        const sal_Int32 nContentHeight(nTotalPreferredHeight + nTotalDecorationHeight);
+        SetupVerticalScrollBar(rVerticalScrollBar, nContentHeight, aBox.GetHeight());
+    }
+    else
     {
+        if (nTotalPreferredHeight <= nAvailableHeight)
+            eMode = PreferredOrLarger;
+        else
+            eMode = MinimumOrLarger;
+
         const sal_Int32 nTotalHeight (eMode==MinimumOrLarger ? nTotalMinimumHeight : nTotalPreferredHeight);
 
         DistributeHeights(
@@ -211,15 +216,6 @@ void LayoutPanels (
             eMode==MinimumOrLarger);
     }
 
-    if (bShowVerticalScrollBar)
-    {
-        const sal_Int32 nContentHeight(
-            eMode==Preferred
-                ? nTotalPreferredHeight + nTotalDecorationHeight
-                : aBox.GetHeight());
-        SetupVerticalScrollBar(rVerticalScrollBar, nContentHeight, aBox.GetHeight());
-    }
-
     const sal_Int32 nUsedHeight(PlacePanels(rLayoutItems, eMode));
     rMinimalHeight = nUsedHeight;
 }


More information about the Libreoffice-commits mailing list