diff options
63 files changed, 130 insertions, 255 deletions
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 2f9aa0dfbfdb..aa4627b7c377 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -470,7 +470,7 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const { if ( ppAggregates[i] ) { - const Size aTemp( ppAggregates[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + const Size aTemp(ppAggregates[i]->GetOptimalSize()); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 554454972b11..c0532dc5541d 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -348,7 +348,7 @@ void OSelectionBrowseBox::Init() for (sal_Size i = 0; i < sizeof (pControls) / sizeof (pControls[0]); ++i) { - const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + const Size aTemp(pControls[i]->GetOptimalSize()); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index e5fd25185242..6fd7c3e5ee9f 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -295,7 +295,7 @@ void OTableEditorCtrl::InitCellController() const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell}; for(sal_Size i= 0; i < sizeof(pControls) / sizeof(pControls[0]);++i) { - const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + const Size aTemp(pControls[i]->GetOptimalSize()); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 3d09aece7037..646291d1b5a1 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -258,9 +258,9 @@ namespace aText.SetText( aLicensing ); // positions and sizes are computed to always fit the language - Size aTextSize( aText.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); - Size aShowSize( aShow.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); - Size aCloseSize( aClose.GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + Size aTextSize(aText.GetOptimalSize()); + Size aShowSize(aShow.GetOptimalSize()); + Size aCloseSize(aClose.GetOptimalSize()); long nDelimX = 12; long nDelimY = 12; diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index 4183eef87d41..7e3f847b712f 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -118,7 +118,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con // #i89164# calculate dynamically the width of radiobutton and listbox const long nOffset = 10; Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel(); - Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED ); + Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize(); aNewSize.Width() += nOffset; aNewSize.Height() = aOldSize.Height(); long nDelta = aOldSize.Width() - aNewSize.Width(); @@ -126,7 +126,7 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, con Point aPos = aReduceBitmapsResolutionLB.GetPosPixel(); aPos.X() -= nDelta; aOldSize = aReduceBitmapsResolutionLB.GetSizePixel(); - aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize( WINDOWSIZE_PREFERRED ); + aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize(); aNewSize.Width() += nOffset; aNewSize.Height() = aOldSize.Height(); aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize ); diff --git a/svtools/inc/svtools/toolpanel/paneltabbar.hxx b/svtools/inc/svtools/toolpanel/paneltabbar.hxx index 278ef349155c..0b534f88ed9b 100644 --- a/svtools/inc/svtools/toolpanel/paneltabbar.hxx +++ b/svtools/inc/svtools/toolpanel/paneltabbar.hxx @@ -65,7 +65,7 @@ namespace svt PushButton& GetScrollButton( const bool i_bForward ); // Window overridables - virtual Size GetOptimalSize( WindowSizeType i_eType ) const; + virtual Size GetOptimalSize() const; protected: // Window overridables diff --git a/svtools/inc/svtools/treelistbox.hxx b/svtools/inc/svtools/treelistbox.hxx index ba678aeb9186..c448c78e3463 100644 --- a/svtools/inc/svtools/treelistbox.hxx +++ b/svtools/inc/svtools/treelistbox.hxx @@ -762,7 +762,7 @@ public: long getPreferredDimensions(std::vector<long> &rWidths) const; - virtual Size GetOptimalSize(WindowSizeType i_eType) const; + virtual Size GetOptimalSize() const; }; #define SV_LBOX_DD_FORMAT "SV_LBOX_DD_FORMAT" diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index b6c9613f79ca..eddb6022534e 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -3408,24 +3408,12 @@ long SvTreeListBox::getPreferredDimensions(std::vector<long> &rWidths) const return nHeight; } -Size SvTreeListBox::GetOptimalSize(WindowSizeType eType) const +Size SvTreeListBox::GetOptimalSize() const { - Size aRet; - switch (eType) - { - case WINDOWSIZE_MINIMUM: - case WINDOWSIZE_PREFERRED: - { - std::vector<long> aWidths; - aRet.Height() = getPreferredDimensions(aWidths); - for (size_t i = 0; i < aWidths.size(); ++i) - aRet.Width() += aWidths[i]; - break; - } - default: - aRet = Control::GetOptimalSize(eType); - break; - } + std::vector<long> aWidths; + Size aRet(0, getPreferredDimensions(aWidths)); + for (size_t i = 0; i < aWidths.size(); ++i) + aRet.Width() += aWidths[i]; return aRet; } diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index ca391d440ed7..55e208d7c5e8 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -197,7 +197,7 @@ IMPL_LINK( PlaceEditDialog, SelectTypeHdl, void*, EMPTYARG ) m_pCurrentDetails->show( true ); - SetSizePixel( GetOptimalSize( WINDOWSIZE_MINIMUM ) ); + SetSizePixel(GetOptimalSize()); return 0; } diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index d1dd6eeb20f1..1c08d59d303d 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -1020,10 +1020,10 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Size PanelTabBar::GetOptimalSize( WindowSizeType i_eType ) const + Size PanelTabBar::GetOptimalSize() const { m_pImpl->EnsureItemsCache(); - Size aOptimalSize( m_pImpl->m_aGeometry.getOptimalSize( m_pImpl->m_aItems, i_eType == WINDOWSIZE_MINIMUM ) ); + Size aOptimalSize(m_pImpl->m_aGeometry.getOptimalSize(m_pImpl->m_aItems)); if ( m_pImpl->IsVertical() ) ::std::swap( aOptimalSize.Width(), aOptimalSize.Height() ); return aOptimalSize; diff --git a/svtools/source/toolpanel/tabbargeometry.cxx b/svtools/source/toolpanel/tabbargeometry.cxx index 97b29002d6ce..0eb4fddd1b12 100644 --- a/svtools/source/toolpanel/tabbargeometry.cxx +++ b/svtools/source/toolpanel/tabbargeometry.cxx @@ -256,7 +256,7 @@ namespace svt } //------------------------------------------------------------------------------------------------------------------ - Size TabBarGeometry::getOptimalSize( ItemDescriptors& io_rItems, const bool i_bMinimalSize ) const + Size TabBarGeometry::getOptimalSize(ItemDescriptors& io_rItems) const { if ( io_rItems.empty() ) return Size( @@ -265,7 +265,7 @@ namespace svt ); // the rect of the last item - const Rectangle& rLastItemRect( i_bMinimalSize ? io_rItems.rbegin()->aIconOnlyArea : io_rItems.rbegin()->aCompleteArea ); + const Rectangle& rLastItemRect(io_rItems.rbegin()->aCompleteArea); return Size( rLastItemRect.Left() + 1 + m_aItemsInset.Right(), rLastItemRect.Top() + 1 + rLastItemRect.Bottom() + m_aItemsInset.Bottom() diff --git a/svtools/source/toolpanel/tabbargeometry.hxx b/svtools/source/toolpanel/tabbargeometry.hxx index 04390234f9be..38750a1f55f5 100644 --- a/svtools/source/toolpanel/tabbargeometry.hxx +++ b/svtools/source/toolpanel/tabbargeometry.hxx @@ -100,7 +100,7 @@ namespace svt /** calculates the optimal size of the tab bar, depending on the item's sizes */ - Size getOptimalSize( ItemDescriptors& io_rItems, const bool i_bMinimalSize ) const; + Size getOptimalSize(ItemDescriptors& io_rItems) const; /** retrieves the position where the first item should start, relative to the item rect */ diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx index 8c445313d105..bd38da4e4592 100644 --- a/svtools/source/toolpanel/tablayouter.cxx +++ b/svtools/source/toolpanel/tablayouter.cxx @@ -124,13 +124,10 @@ namespace svt if ( lcl_checkDisposed( *m_pData ) ) return i_rDeckPlayground; - const Size aPreferredSize( m_pData->pTabBar->GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + const Size aPreferredSize(m_pData->pTabBar->GetOptimalSize()); if ( lcl_isVerticalTabBar( m_pData->eAlignment ) ) { - Size aTabBarSize = ( aPreferredSize.Width() < i_rDeckPlayground.GetWidth() ) - ? aPreferredSize - : m_pData->pTabBar->GetOptimalSize( WINDOWSIZE_MINIMUM ); - aTabBarSize.Height() = i_rDeckPlayground.GetHeight(); + Size aTabBarSize(aPreferredSize.Width(), i_rDeckPlayground.GetHeight()); Rectangle aPanelRect( i_rDeckPlayground ); if ( m_pData->eAlignment == TABS_RIGHT ) @@ -151,10 +148,7 @@ namespace svt return aPanelRect; } - Size aTabBarSize = ( aPreferredSize.Height() < i_rDeckPlayground.GetHeight() ) - ? aPreferredSize - : m_pData->pTabBar->GetOptimalSize( WINDOWSIZE_MINIMUM ); - aTabBarSize.Width() = i_rDeckPlayground.GetWidth(); + Size aTabBarSize(i_rDeckPlayground.GetWidth(), aPreferredSize.Height()); Rectangle aPanelRect( i_rDeckPlayground ); if ( m_pData->eAlignment == TABS_TOP ) diff --git a/svx/inc/svx/fntctrl.hxx b/svx/inc/svx/fntctrl.hxx index 3df73a88fabc..e801eebaa7b4 100644 --- a/svx/inc/svx/fntctrl.hxx +++ b/svx/inc/svx/fntctrl.hxx @@ -89,7 +89,7 @@ public: void SetFromItemSet( const SfxItemSet &rSet, bool bPreviewBackgroundToCharacter = false ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; #endif // #ifndef _SVX_FNTCTRL_HXX diff --git a/svx/inc/svx/pagectrl.hxx b/svx/inc/svx/pagectrl.hxx index 252d3ae5de44..9a6e2ca90821 100644 --- a/svx/inc/svx/pagectrl.hxx +++ b/svx/inc/svx/pagectrl.hxx @@ -155,7 +155,7 @@ public: void ResetBackground(); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; #endif // #ifndef _SVX_PAGECTRL_HXX diff --git a/svx/inc/svx/rubydialog.hxx b/svx/inc/svx/rubydialog.hxx index ea7b313d35c3..f1538a32c3ec 100644 --- a/svx/inc/svx/rubydialog.hxx +++ b/svx/inc/svx/rubydialog.hxx @@ -52,7 +52,7 @@ public: { m_pParentDlg = pParentDlg; } - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; class SVX_DLLPUBLIC SvxRubyChildWindow : public SfxChildWindow diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index d32ef0aa171d..d40ecb0cdfa3 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -1489,11 +1489,8 @@ void SvxFontPrevWindow::SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, Invalidate(); } -Size SvxFontPrevWindow::GetOptimalSize(WindowSizeType eType) const +Size SvxFontPrevWindow::GetOptimalSize() const { - if (eType == WINDOWSIZE_MAXIMUM) - return Window::GetOptimalSize(eType); - return m_aInitialSize; } diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 0fadd16e876b..3dba3d404a54 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -129,7 +129,7 @@ SvxPageWindow::SvxPageWindow( Window* pParent ) : // Count in Twips by default SetMapMode( MapMode( MAP_TWIP ) ); - aWinSize = GetOptimalSize(WINDOWSIZE_PREFERRED); + aWinSize = GetOptimalSize(); aWinSize.Height() -= 4; aWinSize.Width() -= 4; @@ -437,11 +437,9 @@ void SvxPageWindow::ResetBackground() pImpl->bResetBackground = sal_True; } -Size SvxPageWindow::GetOptimalSize(WindowSizeType eType) const +Size SvxPageWindow::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT)); - return Window::GetOptimalSize(eType); + return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 8f049b5da8cf..00d0ff002fd6 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -878,11 +878,9 @@ void RubyPreview::Paint( const Rectangle& /* rRect */ ) SetFont(aSaveFont); } -Size RubyPreview::GetOptimalSize(WindowSizeType eType) const +Size RubyPreview::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(215, 50), MapMode(MAP_APPFONT)); - return Window::GetOptimalSize(eType); + return LogicToPixel(Size(215, 50), MapMode(MAP_APPFONT)); } void RubyEdit::GetFocus() diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index fe695aaed2c2..add08275e3ef 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -208,11 +208,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwDBTreeList(Window *pParen return new SwDBTreeList(pParent); } -Size SwDBTreeList::GetOptimalSize(WindowSizeType eType) const +Size SwDBTreeList::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(100, 62), MapMode(MAP_APPFONT)); - return SvTreeListBox::GetOptimalSize(eType); + return LogicToPixel(Size(100, 62), MapMode(MAP_APPFONT)); } SwDBTreeList::~SwDBTreeList() diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx index 147e45f3e59c..a5204334ef91 100644 --- a/sw/source/ui/frmdlg/colex.cxx +++ b/sw/source/ui/frmdlg/colex.cxx @@ -300,7 +300,7 @@ SwColumnOnlyExample::SwColumnOnlyExample(Window* pParent) , m_aFrmSize(1,1) { SetMapMode( MapMode( MAP_TWIP ) ); - m_aWinSize = GetOptimalSize(WINDOWSIZE_PREFERRED); + m_aWinSize = GetOptimalSize(); m_aWinSize.Height() -= 4; m_aWinSize.Width() -= 4; @@ -456,11 +456,9 @@ void SwColumnOnlyExample::SetColumns(const SwFmtCol& rCol) } } -Size SwColumnOnlyExample::GetOptimalSize(WindowSizeType eType) const +Size SwColumnOnlyExample::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT)); - return Window::GetOptimalSize(eType); + return LogicToPixel(Size(75, 46), MapMode(MAP_APPFONT)); } SwPageGridExample::~SwPageGridExample() diff --git a/sw/source/ui/inc/colex.hxx b/sw/source/ui/inc/colex.hxx index d3263139e82a..d9be70b446cf 100644 --- a/sw/source/ui/inc/colex.hxx +++ b/sw/source/ui/inc/colex.hxx @@ -112,7 +112,7 @@ public: void SetColumns(const SwFmtCol& rCol); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; #endif // _COLEX_HXX diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx index fc27c48e7804..dba79bc7d0fe 100644 --- a/sw/source/ui/inc/dbtree.hxx +++ b/sw/source/ui/inc/dbtree.hxx @@ -58,7 +58,7 @@ public: const sal_Bool bShowCol = sal_False ); SwDBTreeList(Window* pParent); virtual ~SwDBTreeList(); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; String GetDBName( String& rTableName, String& rColumnName, sal_Bool* pbIsTable = 0); diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx index a200b55b96cc..afd47aa30999 100644 --- a/sw/source/ui/inc/glossary.hxx +++ b/sw/source/ui/inc/glossary.hxx @@ -73,7 +73,7 @@ public: SwGlTreeListBox(Window* pParent, WinBits nBits); virtual void RequestHelp( const HelpEvent& rHEvt ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void Clear(); }; diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx index 8d4e31a2cd97..658a77eb3f21 100644 --- a/sw/source/ui/inc/unotools.hxx +++ b/sw/source/ui/inc/unotools.hxx @@ -43,7 +43,7 @@ public: SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame); virtual void Command( const CommandEvent& rCEvt ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual void Resize(); }; diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 975281f907c8..ecec7b1551a2 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -850,11 +850,9 @@ SwGlTreeListBox::SwGlTreeListBox(Window* pParent, WinBits nBits) SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY ); } -Size SwGlTreeListBox::GetOptimalSize(WindowSizeType eType) const +Size SwGlTreeListBox::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(212, 84), MapMode(MAP_APPFONT)); - return SvTreeListBox::GetOptimalSize(eType); + return LogicToPixel(Size(212, 84), MapMode(MAP_APPFONT)); } extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwGlTreeListBox(Window *pParent, VclBuilder::stringmap &) diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index e9e89dfba380..76f6991609c1 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -861,7 +861,7 @@ SwFieldDialog::SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ) : } } - Size lbSize=aListBox.GetOptimalSize(WINDOWSIZE_PREFERRED); + Size lbSize(aListBox.GetOptimalSize()); lbSize.Width()+=50; lbSize.Height()+=20; aListBox.SetSizePixel(lbSize); diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index 19933c379e97..f5b144416a6e 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -542,11 +542,9 @@ void SwFrmCtrlWindow::Command( const CommandEvent& rCEvt ) } } -Size SwFrmCtrlWindow::GetOptimalSize(WindowSizeType eType) const +Size SwFrmCtrlWindow::GetOptimalSize() const { - if (eType == WINDOWSIZE_PREFERRED) - return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT)); - return VclEventBox::GetOptimalSize(eType); + return LogicToPixel(Size(82, 124), MapMode(MAP_APPFONT)); } void SwFrmCtrlWindow::Resize() diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index 5609ea7e16bc..b97a6bd00e81 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2194,7 +2194,7 @@ void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com:: case WINDOW_SCROLLBARBOX: return VCLXScrollBar::implGetMinimumSize( GetWindow() ); default: - aSz = GetWindow()->GetOptimalSize( WINDOWSIZE_MINIMUM ); + aSz = GetWindow()->GetOptimalSize(); } } diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx index d0e976430e39..55da2232bfbe 100644 --- a/vcl/inc/brdwin.hxx +++ b/vcl/inc/brdwin.hxx @@ -178,7 +178,7 @@ public: Rectangle GetMenuRect() const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; // ======================================================================= diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 3a0cbb7c7669..d57218ebd2bb 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -82,7 +82,7 @@ namespace vcl ShowNupOrderWindow( Window* pParent ); virtual ~ShowNupOrderWindow(); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual void Paint( const Rectangle& ); diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index 46be2854e301..47a44012a195 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -186,7 +186,7 @@ public: TriState GetSavedValue() const { return meSaveValue; } Size CalcMinimumSize( long nMaxWidth = 0 ) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; } const Link& GetToggleHdl() const { return maToggleHdl; } @@ -379,7 +379,7 @@ public: static Image GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlags ); Size CalcMinimumSize( long nMaxWidth = 0 ) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; } const Link& GetToggleHdl() const { return maToggleHdl; } @@ -493,7 +493,7 @@ public: static Image GetCheckImage( const AllSettings& rSettings, sal_uInt16 nFlags ); Size CalcMinimumSize( long nMaxWidth = 0 ) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; } const Link& GetToggleHdl() const { return maToggleHdl; } diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx index 72478c59a713..d0364105afb6 100644 --- a/vcl/inc/vcl/combobox.hxx +++ b/vcl/inc/vcl/combobox.hxx @@ -167,7 +167,7 @@ public: const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; } Size CalcMinimumSize() const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; Size CalcAdjustedSize( const Size& rPrefSize ) const; using Edit::CalcSize; Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const; diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx index 682038602785..bd178f05657c 100644 --- a/vcl/inc/vcl/ctrl.hxx +++ b/vcl/inc/vcl/ctrl.hxx @@ -173,7 +173,7 @@ public: void SetLayoutDataParent( const Control* pParent ) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; /** sets a reference device used for rendering control text @seealso DrawControlText diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx index 6f5b0c0db934..7f16d07dd033 100644 --- a/vcl/inc/vcl/dialog.hxx +++ b/vcl/inc/vcl/dialog.hxx @@ -91,7 +91,7 @@ public: virtual void StateChanged( StateChangedType nStateChange ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual void Resize(); bool isLayoutEnabled() const; void setInitialLayoutSize(); diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx index 3957f69471de..10d3fe44a160 100644 --- a/vcl/inc/vcl/edit.hxx +++ b/vcl/inc/vcl/edit.hxx @@ -230,7 +230,7 @@ public: virtual Size CalcMinimumSize() const; virtual Size CalcMinimumSizeForText(const rtl::OUString &rString) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual Size CalcSize( sal_uInt16 nChars ) const; virtual xub_StrLen GetMaxVisChars() const; diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx index 22ed857ebd7e..7e1502595ddb 100644 --- a/vcl/inc/vcl/fixed.hxx +++ b/vcl/inc/vcl/fixed.hxx @@ -73,7 +73,7 @@ public: static Size CalcMinimumTextSize(Control const* pControl, long nMaxWidth = 0x7fffffff); static Size getTextDimensions(Control const *pControl, const OUString &rTxt, long nMaxWidth); Size CalcMinimumSize(long nMaxWidth = 0x7fffffff) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue); }; @@ -116,7 +116,7 @@ public: virtual void StateChanged( StateChangedType nType ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; // --------------- @@ -188,7 +188,7 @@ public: virtual void StateChanged( StateChangedType nType ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); virtual void UserDraw( const UserDrawEvent& rUDEvt ); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void SetImage( const Image& rImage ); const Image& GetImage() const { return maImage; } diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx index 7c71d9ccb928..073433f462ed 100644 --- a/vcl/inc/vcl/layout.hxx +++ b/vcl/inc/vcl/layout.hxx @@ -21,7 +21,7 @@ class VCL_DLLPUBLIC VclContainer : public Window { public: VclContainer(Window *pParent, WinBits nStyle = WB_HIDE); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize); virtual void SetPosPixel(const Point& rAllocPos); virtual void SetSizePixel(const Size& rAllocation); diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx index cabc30bfb027..694f45c882b5 100644 --- a/vcl/inc/vcl/lstbox.hxx +++ b/vcl/inc/vcl/lstbox.hxx @@ -189,7 +189,7 @@ public: Size CalcSubEditSize() const; //size of area inside lstbox, i.e. no scrollbar/dropdown Size CalcMinimumSize() const; //size of lstbox area, i.e. including scrollbar/dropdown - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; Size CalcAdjustedSize( const Size& rPrefSize ) const; Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const; void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const; diff --git a/vcl/inc/vcl/msgbox.hxx b/vcl/inc/vcl/msgbox.hxx index cd9e86024280..8f0336dc045d 100644 --- a/vcl/inc/vcl/msgbox.hxx +++ b/vcl/inc/vcl/msgbox.hxx @@ -93,7 +93,7 @@ public: void SetCheckBoxState( sal_Bool bCheck ); sal_Bool GetCheckBoxState() const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; // ----------- diff --git a/vcl/inc/vcl/scrbar.hxx b/vcl/inc/vcl/scrbar.hxx index 7c62d941d5fe..4a1a164121be 100644 --- a/vcl/inc/vcl/scrbar.hxx +++ b/vcl/inc/vcl/scrbar.hxx @@ -140,7 +140,7 @@ public: void SetEndScrollHdl( const Link& rLink ) { maEndScrollHdl = rLink; } const Link& GetEndScrollHdl() const { return maEndScrollHdl; } - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; // ---------------- diff --git a/vcl/inc/vcl/spinfld.hxx b/vcl/inc/vcl/spinfld.hxx index 578aebb1ea88..4d38a2ea9dc0 100644 --- a/vcl/inc/vcl/spinfld.hxx +++ b/vcl/inc/vcl/spinfld.hxx @@ -102,7 +102,7 @@ public: virtual Size CalcMinimumSize() const; virtual Size CalcMinimumSizeForText(const rtl::OUString &rString) const; - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; virtual Size CalcSize( sal_uInt16 nChars ) const; }; diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index 39cbad314c48..f2928d9cadd9 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -111,7 +111,7 @@ public: virtual void ActivatePage(); virtual long DeactivatePage(); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; void SetTabPageSizePixel( const Size& rSize ); Size GetTabPageSizePixel() const; diff --git a/vcl/inc/vcl/tabpage.hxx b/vcl/inc/vcl/tabpage.hxx index 1aa4b91a778b..769003d0357e 100644 --- a/vcl/inc/vcl/tabpage.hxx +++ b/vcl/inc/vcl/tabpage.hxx @@ -59,7 +59,7 @@ public: virtual void SetPosSizePixel(const Point& rNewPos, const Size& rNewSize); virtual void SetPosPixel(const Point& rNewPos); virtual void SetSizePixel(const Size& rNewSize); - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; }; #endif // _SV_TABPAGE_HXX diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index f0ceb9a3e1b8..66c0cfa6e233 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -316,13 +316,6 @@ typedef sal_uInt16 StateChangedType; #define DLGWINDOW_NEXT 1 #define DLGWINDOW_FIRST 2 -enum WindowSizeType -{ - WINDOWSIZE_MINIMUM, - WINDOWSIZE_PREFERRED, - WINDOWSIZE_MAXIMUM -}; - // ---------- // - Window - // ---------- @@ -1064,7 +1057,7 @@ public: * Implement this in sub-classes to tell layout * the preferred widget size. */ - virtual Size GetOptimalSize(WindowSizeType eType) const; + virtual Size GetOptimalSize() const; /* * Widgets call this to inform their owner container that the widget wants diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 8ad4c6cb6324..16190b482913 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1707,15 +1707,9 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const return CalcWindowSize( aSize ); } -Size PushButton::GetOptimalSize(WindowSizeType eType) const +Size PushButton::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: { - return CalcMinimumSize(); - } - default: - return Button::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } bool PushButton::set_property(const rtl::OString &rKey, const rtl::OString &rValue) @@ -3077,14 +3071,9 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const // ----------------------------------------------------------------------- -Size RadioButton::GetOptimalSize(WindowSizeType eType) const +Size RadioButton::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Button::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ======================================================================= @@ -3992,14 +3981,9 @@ Size CheckBox::CalcMinimumSize( long nMaxWidth ) const // ----------------------------------------------------------------------- -Size CheckBox::GetOptimalSize(WindowSizeType eType) const +Size CheckBox::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Button::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ======================================================================= diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 389929c34b53..75f4e307e5e4 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1016,14 +1016,9 @@ long ComboBox::CalcWindowSizePixel( sal_uInt16 nLines ) const // ----------------------------------------------------------------------- -Size ComboBox::GetOptimalSize(WindowSizeType eType) const +Size ComboBox::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Edit::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 8ebd3ebf124c..debdc4fab382 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -455,18 +455,10 @@ ControlLayoutData::~ControlLayoutData() // ----------------------------------------------------------------- -Size Control::GetOptimalSize(WindowSizeType eType) const -{ - switch (eType) { - case WINDOWSIZE_MINIMUM: - return Size( GetTextWidth( GetText() ) + 2 * 12, - GetTextHeight() + 2 * 6 ); - case WINDOWSIZE_PREFERRED: - return GetOptimalSize( WINDOWSIZE_MINIMUM ); - case WINDOWSIZE_MAXIMUM: - default: - return Size( LONG_MAX, LONG_MAX ); - } +Size Control::GetOptimalSize() const +{ + return Size( GetTextWidth( GetText() ) + 2 * 12, + GetTextHeight() + 2 * 6 ); } // ----------------------------------------------------------------- diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 513fd51e2d11..3e177d09a184 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2954,14 +2954,9 @@ Size Edit::GetMinimumEditSize() // ----------------------------------------------------------------------- -Size Edit::GetOptimalSize(WindowSizeType eType) const +Size Edit::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Control::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 4646f3b42983..42b150ce885b 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -417,34 +417,26 @@ Size FixedText::CalcMinimumSize( long nMaxWidth ) const } // ----------------------------------------------------------------------- -Size FixedText::GetOptimalSize(WindowSizeType eType) const +Size FixedText::GetOptimalSize() const { - switch (eType) + sal_Int32 nMaxAvailWidth = 0x7fffffff; + const OUString &rTxt = GetText(); + if (m_nMaxWidthChars != -1 && m_nMaxWidthChars < rTxt.getLength()) { - case WINDOWSIZE_MINIMUM: - { - sal_Int32 nMaxAvailWidth = 0x7fffffff; - const OUString &rTxt = GetText(); - if (m_nMaxWidthChars != -1 && m_nMaxWidthChars < rTxt.getLength()) - { - nMaxAvailWidth = getTextDimensions(this, - rTxt.copy(0, m_nMaxWidthChars), 0x7fffffff).Width(); - } - Size aRet = CalcMinimumSize(nMaxAvailWidth); - if (m_nMinWidthChars != -1) - { - OUStringBuffer aBuf; - comphelper::string::padToLength(aBuf, m_nMinWidthChars, 'x'); - Size aMinAllowed = getTextDimensions(this, - aBuf.makeStringAndClear(), 0x7fffffff); - if (aMinAllowed.Width() > aRet.Width()) - aRet = aMinAllowed; - } - return aRet; - } - default: - return Control::GetOptimalSize( eType ); + nMaxAvailWidth = getTextDimensions(this, + rTxt.copy(0, m_nMaxWidthChars), 0x7fffffff).Width(); + } + Size aRet = CalcMinimumSize(nMaxAvailWidth); + if (m_nMinWidthChars != -1) + { + OUStringBuffer aBuf; + comphelper::string::padToLength(aBuf, m_nMinWidthChars, 'x'); + Size aMinAllowed = getTextDimensions(this, + aBuf.makeStringAndClear(), 0x7fffffff); + if (aMinAllowed.Width() > aRet.Width()) + aRet = aMinAllowed; } + return aRet; } // ----------------------------------------------------------------------- @@ -753,14 +745,9 @@ void FixedLine::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------- -Size FixedLine::GetOptimalSize(WindowSizeType eType) const +Size FixedLine::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcWindowSize( FixedText::CalcMinimumTextSize ( this, 0x7fffffff ) ); - default: - return Control::GetOptimalSize( eType ); - } + return CalcWindowSize( FixedText::CalcMinimumTextSize ( this, 0x7fffffff ) ); } // ======================================================================= @@ -1106,10 +1093,9 @@ void FixedImage::Paint( const Rectangle& ) // ----------------------------------------------------------------------- -Size FixedImage::GetOptimalSize( WindowSizeType ) const +Size FixedImage::GetOptimalSize() const { - const Image* pImage = &maImage; - return pImage->GetSizePixel(); + return maImage.GetSizePixel(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index f36204b1420a..beb216d12c07 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1354,14 +1354,9 @@ Size ListBox::CalcSubEditSize() const // ----------------------------------------------------------------------- -Size ListBox::GetOptimalSize(WindowSizeType eType) const +Size ListBox::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Control::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index b99ff260188c..b2ffb7f2c29f 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -1507,7 +1507,7 @@ void ScrollBar::SetVisibleSize( long nNewSize ) } } -Size ScrollBar::GetOptimalSize(WindowSizeType) const +Size ScrollBar::GetOptimalSize() const { if (mbCalcSize) const_cast<ScrollBar*>(this)->ImplCalc(sal_False); diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index cba366d1b682..604c386587ba 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -995,14 +995,9 @@ Size SpinField::CalcMinimumSize() const // ----------------------------------------------------------------------- -Size SpinField::GetOptimalSize(WindowSizeType eType) const +Size SpinField::GetOptimalSize() const { - switch (eType) { - case WINDOWSIZE_MINIMUM: - return CalcMinimumSize(); - default: - return Edit::GetOptimalSize( eType ); - } + return CalcMinimumSize(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index e2fecc29e0d1..02ac5337de03 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -2219,7 +2219,7 @@ Size TabControl::calculateRequisition() const if (!pPage) continue; - Size aPageSize(pPage->GetOptimalSize(WINDOWSIZE_PREFERRED)); + Size aPageSize(pPage->GetOptimalSize()); if (aPageSize.Width() > aOptimalPageSize.Width()) aOptimalPageSize.Width() = aPageSize.Width(); @@ -2251,10 +2251,8 @@ Size TabControl::calculateRequisition() const return aOptimalSize; } -Size TabControl::GetOptimalSize(WindowSizeType eType) const +Size TabControl::GetOptimalSize() const { - if (eType == WINDOWSIZE_MINIMUM) - return Size(); return calculateRequisition(); } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 9fea710b10b2..60b20a6ab623 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -2360,16 +2360,12 @@ Rectangle ImplBorderWindow::GetMenuRect() const return mpBorderView->GetMenuRect(); } -Size ImplBorderWindow::GetOptimalSize(WindowSizeType eType) const +Size ImplBorderWindow::GetOptimalSize() const { - if (eType == WINDOWSIZE_MAXIMUM) - return Size(mnMaxWidth, mnMaxHeight); - if (eType == WINDOWSIZE_MINIMUM) - return Size(mnMinWidth, mnMinHeight); - Window* pClientWindow = ImplGetClientWindow(); + const Window* pClientWindow = ImplGetClientWindow(); if (pClientWindow) - return pClientWindow->GetOptimalSize(eType); - return Size(0, 0); + return pClientWindow->GetOptimalSize(); + return Size(mnMinWidth, mnMinHeight); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 53eafdf6f782..1aef3e6296cd 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1188,10 +1188,10 @@ bool Dialog::isLayoutEnabled() const return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(WINDOW_NEXT); } -Size Dialog::GetOptimalSize(WindowSizeType eType) const +Size Dialog::GetOptimalSize() const { - if (eType == WINDOWSIZE_MAXIMUM || !isLayoutEnabled()) - return SystemWindow::GetOptimalSize(eType); + if (!isLayoutEnabled()) + return SystemWindow::GetOptimalSize(); Size aSize = VclContainer::getLayoutRequisition(*GetWindow(WINDOW_FIRSTCHILD)); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 7364b11ef6a9..a6d9d409b541 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -21,10 +21,8 @@ VclContainer::VclContainer(Window *pParent, WinBits nStyle) SetBackground(); } -Size VclContainer::GetOptimalSize(WindowSizeType eType) const +Size VclContainer::GetOptimalSize() const { - if (eType == WINDOWSIZE_MAXIMUM) - return Window::GetOptimalSize(eType); return calculateRequisition(); } diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 86dd2233a748..6aca66e50320 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -426,15 +426,10 @@ void MessBox::SetCheckBoxState( sal_Bool bCheck ) // ----------------------------------------------------------------------- -Size MessBox::GetOptimalSize(WindowSizeType eType) const +Size MessBox::GetOptimalSize() const { - switch( eType ) { - case WINDOWSIZE_MINIMUM: - // FIXME: base me on the font size ? - return Size( 250, 100 ); - default: - return Window::GetOptimalSize( eType ); - } + // FIXME: base me on the font size ? + return Size( 250, 100 ); } // ============================================================================ diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 97614b2f1704..2222eb8f876d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -301,7 +301,7 @@ void PrintDialog::ShowNupOrderWindow::ImplInitSettings() SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); } -Size PrintDialog::ShowNupOrderWindow::GetOptimalSize(WindowSizeType) const +Size PrintDialog::ShowNupOrderWindow::GetOptimalSize() const { return Size(70, 70); } diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index d6dbcd38f7bc..7dfeb14c4a20 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -56,7 +56,7 @@ void TabDialog::ImplPosControls() pTabControl = pChild; else if ( pTabControl ) { - Size aOptimalSize( pChild->GetOptimalSize( WINDOWSIZE_PREFERRED ) ); + Size aOptimalSize(pChild->GetOptimalSize()); long nTxtWidth = aOptimalSize.Width(); if ( nTxtWidth > aCtrlSize.Width() ) aCtrlSize.Width() = nTxtWidth; @@ -86,7 +86,7 @@ void TabDialog::ImplPosControls() Point aTabOffset( IMPL_DIALOG_OFFSET, IMPL_DIALOG_OFFSET+nOffY ); if (isContainerWindow(*pTabControl)) - pTabControl->SetSizePixel(pTabControl->GetOptimalSize(WINDOWSIZE_PREFERRED)); + pTabControl->SetSizePixel(pTabControl->GetOptimalSize()); Size aTabSize = pTabControl->GetSizePixel(); diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index 5f04373db18a..b15d9c1ea09a 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -207,16 +207,11 @@ bool TabPage::isLayoutEnabled() const return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(WINDOW_NEXT); } -Size TabPage::GetOptimalSize(WindowSizeType eType) const +Size TabPage::GetOptimalSize() const { - if (eType == WINDOWSIZE_MAXIMUM) - return Window::GetOptimalSize(eType); - Size aSize; if (isLayoutEnabled()) - aSize = GetWindow(WINDOW_FIRSTCHILD)->GetOptimalSize(eType); - else - aSize = getLegacyBestSizeForChildren(*this); - return Window::CalcWindowSize(aSize); + return GetWindow(WINDOW_FIRSTCHILD)->GetOptimalSize(); + return getLegacyBestSizeForChildren(*this); } void TabPage::SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 72d117df22d3..acf9aada3c5e 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -2014,7 +2014,7 @@ namespace Size aRet(rWindow.get_width_request(), rWindow.get_height_request()); if (aRet.Width() == -1 || aRet.Height() == -1) { - Size aOptimal = rWindow.GetOptimalSize(WINDOWSIZE_PREFERRED); + Size aOptimal = rWindow.GetOptimalSize(); if (aRet.Width() == -1) aRet.Width() = aOptimal.Width(); if (aRet.Height() == -1) diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx index b901276655ff..00919acce11a 100644 --- a/vcl/source/window/window3.cxx +++ b/vcl/source/window/window3.cxx @@ -32,18 +32,9 @@ WaitObject::~WaitObject() // ----------------------------------------------------------------------- -Size Window::GetOptimalSize(WindowSizeType eType) const +Size Window::GetOptimalSize() const { - switch (eType) - { - case WINDOWSIZE_MINIMUM: - return Size(); - case WINDOWSIZE_PREFERRED: - return GetOptimalSize( WINDOWSIZE_MINIMUM ); - case WINDOWSIZE_MAXIMUM: - default: - return Size( LONG_MAX, LONG_MAX ); - } + return Size(); } // ----------------------------------------------------------------------- |