X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ab9893576c877f5691023315c23c8348d9d6affd..0f5378d414cb68caaa535199c1af12dec1720c3d:/src/common/rearrangectrl.cpp?ds=sidebyside diff --git a/src/common/rearrangectrl.cpp b/src/common/rearrangectrl.cpp index 6027fd2fb3..2e0ba1bcc6 100644 --- a/src/common/rearrangectrl.cpp +++ b/src/common/rearrangectrl.cpp @@ -134,11 +134,11 @@ void wxRearrangeList::Swap(int pos1, int pos2) // first the label const wxString stringTmp = GetString(pos1); SetString(pos1, GetString(pos2)); - Check(pos1, IsChecked(pos2)); + SetString(pos2, stringTmp); // then the checked state const bool checkedTmp = IsChecked(pos1); - SetString(pos2, stringTmp); + Check(pos1, IsChecked(pos2)); Check(pos2, checkedTmp); // and finally the client data, if necessary @@ -285,8 +285,19 @@ bool wxRearrangeDialog::Create(wxWindow *parent, // notice that the items in this sizer should be inserted accordingly to // wxRearrangeDialogSizerPositions order wxSizer * const sizerTop = new wxBoxSizer(wxVERTICAL); - sizerTop->Add(new wxStaticText(this, wxID_ANY, message), - wxSizerFlags().Border()); + + if ( !message.empty() ) + { + sizerTop->Add(new wxStaticText(this, wxID_ANY, message), + wxSizerFlags().Border()); + } + else + { + // for convenience of other wxRearrangeDialog code that depends on + // positions of sizer items, insert a dummy zero-sized item + sizerTop->AddSpacer(0); + } + sizerTop->Add(m_ctrl, wxSizerFlags(1).Expand().Border()); sizerTop->Add(CreateSeparatedButtonSizer(wxOK | wxCANCEL),