From 61d10a7328d64e044471718a7da9be88feaffeab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Feb 2022 15:38:07 +0100 Subject: [PATCH] Remove unnecessary wxSizer::Fit() calls wxSizer::SetSizeHints() already does what Fit() does (while also setting the minimum window size to the fitting size), so there is no need to call both of them. No real changes, just some cleanup. --- src/generic/choicdgg.cpp | 1 - src/generic/colrdlgg.cpp | 1 - src/generic/dirdlgg.cpp | 1 - src/generic/fdrepdlg.cpp | 1 - src/generic/fontdlgg.cpp | 1 - src/generic/msgdlgg.cpp | 1 - src/generic/numdlgg.cpp | 1 - src/generic/propdlg.cpp | 1 - src/generic/textdlgg.cpp | 1 - src/generic/tipdlg.cpp | 1 - src/osx/carbon/fontdlg.cpp | 1 - 11 files changed, 11 deletions(-) diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index e916182fb9..37875da7de 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -372,7 +372,6 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); if ( styleDlg & wxCENTRE ) Centre(wxBOTH); diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index e6b2579781..3da6fc4433 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -395,7 +395,6 @@ void wxGenericColourDialog::CreateWidgets() SetSizer( topSizer ); topSizer->SetSizeHints( this ); - topSizer->Fit( this ); Centre( wxBOTH ); } diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index cc4585f7b5..c00c18635c 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -160,7 +160,6 @@ bool wxGenericDirDialog::Create(wxWindow* parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); Centre( wxBOTH ); diff --git a/src/generic/fdrepdlg.cpp b/src/generic/fdrepdlg.cpp index d210f71c11..9dc2d763f0 100644 --- a/src/generic/fdrepdlg.cpp +++ b/src/generic/fdrepdlg.cpp @@ -207,7 +207,6 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); Centre( wxBOTH ); diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 80ac67ea4d..766be45987 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -513,7 +513,6 @@ void wxGenericFontDialog::CreateWidgets() GetSizer()->SetItemMinSize(m_previewer, is_pda ? 100 : 430, is_pda ? 40 : 100); GetSizer()->SetSizeHints(this); - GetSizer()->Fit(this); Centre(wxBOTH); diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 0eab99dc2a..0f283b7b19 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -220,7 +220,6 @@ void wxGenericMessageDialog::DoCreateMsgdialog() SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); wxSize size( GetSize() ); if (size.x < size.y*3/2) { diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index aa583904bb..60c1382702 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -123,7 +123,6 @@ bool wxNumberEntryDialog::Create(wxWindow *parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); Centre( wxBOTH ); diff --git a/src/generic/propdlg.cpp b/src/generic/propdlg.cpp index 264871c0fe..dca22468d2 100644 --- a/src/generic/propdlg.cpp +++ b/src/generic/propdlg.cpp @@ -88,7 +88,6 @@ void wxPropertySheetDialog::Init() // Layout the dialog, to be called after pages have been created void wxPropertySheetDialog::LayoutDialog(int centreFlags) { - GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); if (centreFlags) Centre(centreFlags); diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index dd6dfe5d0c..10a44ab181 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -114,7 +114,6 @@ bool wxTextEntryDialog::Create(wxWindow *parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); if ( style & wxCENTRE ) Centre( wxBOTH ); diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index b45517ecef..896b28fd3c 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -272,7 +272,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent, SetSizer( topsizer ); topsizer->SetSizeHints( this ); - topsizer->Fit( this ); Centre(wxBOTH | wxCENTER_FRAME); } diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index 7e93f235b5..9a3b7fd6d6 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -297,7 +297,6 @@ bool wxFontDialog::Create(wxWindow* parent, const wxFontData& fontData) wxDialog::Create( parent, wxID_ANY, caption, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); CreateControls(); - GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); Centre();