[Libreoffice-commits] .: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 24 08:29:17 PDT 2012


 vcl/source/window/layout.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit e0c4e1f8b7258a3a6e38e4115c03e4315541a8de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 24 16:28:17 2012 +0100

    honour padding property in VclBox
    
    Change-Id: Ie387898535ec8f638c4a2a2785cdb39273136f0e

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9a73095..548e06e 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -111,6 +111,11 @@ Size VclBox::calculateRequisition() const
             continue;
         ++nVisibleChildren;
         Size aChildSize = getLayoutRequisition(*pChild);
+
+        long nPrimaryDimension = getPrimaryDimension(aChildSize);
+        nPrimaryDimension += pChild->get_padding() * 2;
+        setPrimaryDimension(aChildSize, nPrimaryDimension);
+
         accumulateMaxes(aChildSize, aSize);
     }
 
@@ -175,10 +180,10 @@ void VclBox::setAllocation(const Size &rAllocation)
             {
                 aBoxSize = getLayoutRequisition(*pChild);
                 long nPrimaryDimension = getPrimaryDimension(aBoxSize);
-                nPrimaryDimension += nPadding;
-                bool bExpand = pChild->get_expand();
-                if (bExpand)
-                    setPrimaryDimension(aBoxSize, nPrimaryDimension + nExtraSpace);
+                nPrimaryDimension += nPadding * 2;
+                if (pChild->get_expand())
+                    nPrimaryDimension += nExtraSpace;
+                setPrimaryDimension(aBoxSize, nPrimaryDimension);
             }
             setSecondaryDimension(aBoxSize, getSecondaryDimension(rAllocation));
 


More information about the Libreoffice-commits mailing list