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

Caolán McNamara caolanm at redhat.com
Fri Apr 5 05:30:43 PDT 2013


 vcl/source/control/tabctrl.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit dac06a943a6c44befda1ba22f4bd19c0281601d0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Apr 5 13:26:26 2013 +0100

    Resolves: fdo#61940 unable to change shape fill colors
    
    The tab area page has a magic bit which is set when the page is activated that
    enables its properties to be applied on ok. If another page is activated that
    also affects area fill using an alternative set of properties, then the bit is
    unset.
    
    For layout we have to activate all pages that don't exist yet to get their
    optimal size. So we need to re-activate the original/current page after forcing
    the other pages to exist in order to make this trickery work.
    
    Change-Id: I90cac4624a12e6c29f6b226ce831f71c7cc49117

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 3e8eb51..3722f80 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2201,6 +2201,7 @@ Size TabControl::calculateRequisition() const
 {
     Size aOptimalPageSize(0, 0);
 
+    sal_uInt16 nOrigPageId = GetCurPageId();
     for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin();
          it != mpTabCtrlData->maItemList.end(); ++it )
     {
@@ -2210,10 +2211,8 @@ Size TabControl::calculateRequisition() const
         if (!pPage)
         {
             TabControl *pThis = const_cast<TabControl*>(this);
-            sal_uInt16 nLastPageId = pThis->GetCurPageId();
             pThis->SetCurPageId(it->mnId);
             pThis->ActivatePage();
-            pThis->SetCurPageId(nLastPageId);
             pPage = it->mpTabPage;
         }
 
@@ -2228,6 +2227,16 @@ Size TabControl::calculateRequisition() const
             aOptimalPageSize.Height() = aPageSize.Height();
     }
 
+    //fdo#61940 If we were forced to activate pages in order to on-demand
+    //create them to get their optimal size, then switch back to the original
+    //page and re-activate it
+    if (nOrigPageId != GetCurPageId())
+    {
+        TabControl *pThis = const_cast<TabControl*>(this);
+        pThis->SetCurPageId(nOrigPageId);
+        pThis->ActivatePage();
+    }
+
     long nTabLabelsBottom = 0, nTabLabelsRight = 0;
     for( std::vector< ImplTabItem >::const_iterator it = mpTabCtrlData->maItemList.begin();
          it != mpTabCtrlData->maItemList.end(); ++it )


More information about the Libreoffice-commits mailing list