summaryrefslogtreecommitdiff
path: root/vcl/source/window/layout.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-31 16:16:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-01 19:38:11 +0200
commitea79a34ec7ffee6f86f16172c9e5fd75257539ca (patch)
tree4d44212158739c7c8658878b0537feae6c56c6ee /vcl/source/window/layout.cxx
parentd2974701e7f9e138ad952eeccb279567b5b309b1 (diff)
allow sorting buttons via weld::Box
Change-Id: I315fe2dd2e40c976edd802c1e87b7ccdb0c298fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95221 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/layout.cxx')
-rw-r--r--vcl/source/window/layout.cxx8
1 files changed, 4 insertions, 4 deletions
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<vcl::Window*> 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();
}