summaryrefslogtreecommitdiff
path: root/vcl/source/window/tabdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-18 13:08:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:32 +0100
commitf2793fd788280b7da2a9064d83c465931baaa13a (patch)
treefe84ad584d9a086fb8126fd0bbe11533695e5f1a /vcl/source/window/tabdlg.cxx
parent3b00eadd184774fa5b26219521830459b7c7440f (diff)
for legacy TabDialogs dialogs hack the hack to reposition the TabControl
hack to get tab dialogs that add extra widgets to a SfxTabDialog parent to continue to work as before now that the SfxTabDialog contains a Container rather than a raw TabControl
Diffstat (limited to 'vcl/source/window/tabdlg.cxx')
-rw-r--r--vcl/source/window/tabdlg.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 2019e52e06de..6a04f6e5de76 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -53,15 +53,16 @@ void TabDialog::ImplPosControls()
Size aCtrlSize( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
long nDownCtrl = 0;
long nOffY = 0;
- TabControl* pTabControl = NULL;
+ Window* pTabControl = NULL;
Window* pChild = GetWindow( WINDOW_FIRSTCHILD );
while ( pChild )
{
if ( pChild->IsVisible() && (pChild != mpViewWindow) )
{
- if ( pChild->GetType() == WINDOW_TABCONTROL )
- pTabControl = (TabControl*)pChild;
+ WindowType eChildType = pChild->GetType();
+ if ( eChildType == WINDOW_TABCONTROL || eChildType == WINDOW_CONTAINER )
+ pTabControl = pChild;
else if ( pTabControl )
{
Size aOptimalSize( pChild->GetOptimalSize( WINDOWSIZE_PREFERRED ) );
@@ -92,7 +93,12 @@ void TabDialog::ImplPosControls()
nOffY += IMPL_DIALOG_BAR_OFFSET*2 + 2;
Point aTabOffset( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+nOffY );
+
+ if (pTabControl->GetType() == WINDOW_CONTAINER)
+ pTabControl->SetSizePixel(pTabControl->GetOptimalSize(WINDOWSIZE_PREFERRED));
+
Size aTabSize = pTabControl->GetSizePixel();
+
Size aDlgSize( aTabSize.Width() + IMPL_DIALOG_OFFSET*2,
aTabSize.Height() + IMPL_DIALOG_OFFSET*2 + nOffY );
long nBtnEx = 0;