From f2793fd788280b7da2a9064d83c465931baaa13a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Jun 2012 13:08:59 +0100 Subject: 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 --- vcl/source/window/tabdlg.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'vcl/source/window/tabdlg.cxx') 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; -- cgit