diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-18 08:10:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:31 +0100 |
commit | 3b00eadd184774fa5b26219521830459b7c7440f (patch) | |
tree | fb19757746f5560da71ee4ab6b1ead511cdc7b5b /vcl | |
parent | afdfa760f6f56795398437881245420fc938eaa8 (diff) |
further improvements to tabcontrol optimal size
One calculation takes the vertical offset into account, which we want
for height. But that one calculates the label width according to the
double-decker layout for over-wide layout, which we don't want.
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 39f24ad2ffb9..ff680ba60a9a 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2152,12 +2152,16 @@ Size TabControl::GetOptimalSize(WindowSizeType eType) const if (aPageSize.Height() > aOptimalPageSize.Height()) aOptimalPageSize.Height() = aPageSize.Height(); - sal_uInt16 nPos = it - mpTabCtrlData->maItemList.begin(); TabControl* pThis = const_cast<TabControl*>(this); + + sal_uInt16 nPos = it - mpTabCtrlData->maItemList.begin(); Rectangle aTabRect = pThis->ImplGetTabRect(nPos, aPageSize.Width(), aPageSize.Height()); if (aTabRect.Bottom() > nTabLabelsBottom) nTabLabelsBottom = aTabRect.Bottom(); - nTotalTabLabelWidths += aTabRect.GetWidth(); + + ImplTabItem* pItem = const_cast<ImplTabItem*>(&(*it)); + Size aTabSize = pThis->ImplGetItemSize(pItem, LONG_MAX); + nTotalTabLabelWidths += aTabSize.Width(); } Size aOptimalSize(aOptimalPageSize); |