From ea79a34ec7ffee6f86f16172c9e5fd75257539ca Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 31 May 2020 16:16:37 +0100 Subject: allow sorting buttons via weld::Box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I315fe2dd2e40c976edd802c1e87b7ccdb0c298fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95221 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/window/layout.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl/source/window/layout.cxx') diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 9225c27b05a8..29c4cf0e7d41 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -789,10 +789,10 @@ bool sortButtons::operator()(const vcl::Window *pA, const vcl::Window *pB) const return getButtonPriority(pA->GetHelpId()) < getButtonPriority(pB->GetHelpId()); } -void VclButtonBox::sort_native_button_order() +void sort_native_button_order(VclBox& rContainer) { std::vector aChilds; - for (vcl::Window* pChild = GetWindow(GetWindowType::FirstChild); pChild; + for (vcl::Window* pChild = rContainer.GetWindow(GetWindowType::FirstChild); pChild; pChild = pChild->GetWindow(GetWindowType::Next)) { aChilds.push_back(pChild); @@ -800,7 +800,7 @@ void VclButtonBox::sort_native_button_order() //sort child order within parent so that we match the platform //button order - std::stable_sort(aChilds.begin(), aChilds.end(), sortButtons(m_bVerticalContainer)); + std::stable_sort(aChilds.begin(), aChilds.end(), sortButtons(rContainer.get_orientation())); BuilderUtils::reorderWithinParent(aChilds, true); } @@ -2295,7 +2295,7 @@ void MessageDialog::create_message_area() break; } set_default_response(nDefaultResponse); - pButtonBox->sort_native_button_order(); + sort_native_button_order(*pButtonBox); m_pMessageBox->Show(); m_pGrid->Show(); } -- cgit v1.2.3