diff options
-rw-r--r-- | vcl/source/window/builder.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 210c867c8e38..2f788ce989c4 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1200,9 +1200,6 @@ namespace xWindow = VclPtr<PushButton>::Create(pParent, nBits); xWindow->SetText(getStockText(sType)); } - PushButton* pPushButton = dynamic_cast<PushButton*>(xWindow.get()); - if (pPushButton) - pPushButton->setStock(true); } if (!xWindow) @@ -2798,17 +2795,23 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) } } + bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr; + //To-Do make reorder a virtual in Window, move this foo //there and see above std::vector<vcl::Window*> aChilds; for (vcl::Window* pChild = pCurrentChild->GetWindow(GetWindowType::FirstChild); pChild; pChild = pChild->GetWindow(GetWindowType::Next)) { + if (bIsButtonBox) + { + if (PushButton* pPushButton = dynamic_cast<PushButton*>(pChild)) + pPushButton->setStock(true); + } + aChilds.push_back(pChild); } - bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != nullptr; - //sort child order within parent so that tabbing //between controls goes in a visually sensible sequence std::stable_sort(aChilds.begin(), aChilds.end(), sortIntoBestTabTraversalOrder(this)); |