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

Oliver-Rainer Wittmann orw at apache.org
Tue May 21 10:52:47 PDT 2013


 sd/source/ui/dlg/navigatr.cxx |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 9ffcc8516ceb5c3b9e522bae6542a9d0e606663e
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue May 21 13:31:56 2013 +0000

    Resolves: #i122260# Calc Navigator - assure that tool box is...
    
    at least as wide as the tree list box to avoid 'bad' layout when the Navigator
    is resized.
    
    (cherry picked from commit 1aead9f230e3953f6049e1700d912d6c14c62e7f)
    
    Change-Id: Ie9aae42c42312777847fdb3261aa74ca7beaccbb

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 88262d7..37ca47b 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -95,7 +95,8 @@ SdNavigatorWin::SdNavigatorWin(
     maToolbox.SetItemBits( TBI_DRAGTYPE, maToolbox.GetItemBits( TBI_DRAGTYPE ) | TIB_DROPDOWNONLY );
 
     // Shape filter drop down menu.
-    maToolbox.SetItemBits(TBI_SHAPE_FILTER,
+    maToolbox.SetItemBits(
+        TBI_SHAPE_FILTER,
         maToolbox.GetItemBits(TBI_SHAPE_FILTER) | TIB_DROPDOWNONLY);
 
     // TreeListBox
@@ -114,8 +115,18 @@ SdNavigatorWin::SdNavigatorWin(
     nListboxYPos = maTlbObjects.GetPosPixel().Y() + maTlbObjects.GetSizePixel().Height() + 4;
     maLbDocs.setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
 
+    // assure that tool box is at least as wide as the tree list box
+    {
+        const Size aTlbSize( maTlbObjects.GetOutputSizePixel() );
+        if ( aTlbSize.Width() > aTbxSize.Width() )
+        {
+            maToolbox.setPosSizePixel( 0, 0, aTlbSize.Width(), 0, WINDOW_POSSIZE_WIDTH );
+            aTbxSize = maToolbox.GetOutputSizePixel();
+        }
+    }
+
     // set min outputsize after all sizes are known
-    long nFullHeight = nListboxYPos + maLbDocs.GetSizePixel().Height() + 4;
+    const long nFullHeight = nListboxYPos + maLbDocs.GetSizePixel().Height() + 4;
     maSize = GetOutputSizePixel();
     if( maSize.Height() < nFullHeight )
     {
@@ -123,7 +134,7 @@ SdNavigatorWin::SdNavigatorWin(
         SetOutputSizePixel( maSize );
     }
     maMinSize = maSize;
-    long nMinWidth = 2*maToolbox.GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
+    const long nMinWidth = 2*maToolbox.GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
     if( nMinWidth > maMinSize.Width() )
         maMinSize.Width() = nMinWidth;
     maMinSize.Height() -= 40;


More information about the Libreoffice-commits mailing list