summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-05 13:26:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-05 13:30:19 +0100
commitdac06a943a6c44befda1ba22f4bd19c0281601d0 (patch)
treecae59040e547c34bf3a3dfd0f4f9fb5c4adb5a0b
parent294d8cc8e198093e61aa4d75a648d84f35c6c91f (diff)
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
-rw-r--r--vcl/source/control/tabctrl.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 3e8eb51bc102..3722f80505a7 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 )