[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 2 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 1 10:13:02 PDT 2012


 sc/source/ui/condformat/condformatdlg.cxx |   39 +++++++++++++-----------------
 1 file changed, 18 insertions(+), 21 deletions(-)

New commits:
commit 6315839cec5c82c9b650d9e4581a79ec6db92603
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Sep 28 12:43:47 2012 +0100

    auto-expand the first conditional format in the list.
    
    Change-Id: I65280d39b560b4b7eed3e21a6e6c7b02c124f10a
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 9fe983f..6b877de 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -979,6 +979,8 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum
         {
             maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos ));
         }
+        if (nCount > 0)
+            maEntries.begin()->Select();
     }
 
     RecalcAll();
commit 5294e6b70bf755b87bc4f87af866c9dd9e99f53e
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Sep 28 11:50:31 2012 +0100

    improve conditional formatting height calculations.
    
    Change-Id: If5080892b820d268ffef22111d0caee217586b56
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index 5c6d0f2..9fe983f 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -494,30 +494,25 @@ void ScCondFrmtEntry::HideColorScaleElements()
 
 void ScCondFrmtEntry::SetHeight()
 {
-    if(mbActive)
+    long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight();
+
+    // Calculate maximum height we need from visible widgets
+    sal_uInt16 nChildren = GetChildCount();
+
+    long nMaxHeight = 0;
+    for(sal_uInt16 i = 0; i < nChildren; i++)
     {
-        Size aSize = GetSizePixel();
-        switch (meType)
-        {
-            case CONDITION:
-            case FORMULA:
-                aSize.Height() = 120;
-                break;
-            case COLORSCALE:
-                aSize.Height() = 200;
-                break;
-            case DATABAR:
-                aSize.Height() = 200;
-                break;
-            default:
-                break;
-        }
-        SetSizePixel(aSize);
+        Window *pChild  = GetChild(i);
+        if(!pChild || !pChild->IsVisible())
+            continue;
+        Point aPos = pChild->GetPosPixel();
+        Size aSize = pChild->GetSizePixel();
+        nMaxHeight = std::max(aPos.Y() + aSize.Height(), nMaxHeight);
     }
-    else
+    Size aSize = GetSizePixel();
+    if(nMaxHeight > 0)
     {
-        Size aSize = GetSizePixel();
-        aSize.Height() = 40;
+        aSize.Height() = nMaxHeight + nPad;
         SetSizePixel(aSize);
     }
 }


More information about the Libreoffice-commits mailing list