diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-18 15:54:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:19 +0100 |
commit | 75e99c7a646c15ed9317577abbe95284060d50a8 (patch) | |
tree | d37121e502f3f17ddc365cf0312dcb6a390c9690 | |
parent | c82b7790e5c4af85a740693f345b39f6d1ac8f04 (diff) |
don't reorder children without position properties
-rw-r--r-- | vcl/source/window/builder.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 380bebc3b021..32829eedcbd4 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -263,7 +263,9 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) for (size_t i = 0; i < aChilds.size(); ++i) { - sal_uInt16 nPosition = aChilds[i]->getWidgetProperty<sal_uInt16>(sPosition); + sal_uInt16 nPosition = aChilds[i]->getWidgetProperty<sal_uInt16>(sPosition, 0xFFFF); + if (nPosition == 0xFFFF) + continue; aChilds[i]->reorderWithinParent(nPosition); } } diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index ef3120115e83..a48277074a0c 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -529,7 +529,7 @@ const Window *VclBin::get_child() const { const WindowImpl* pWindowImpl = ImplGetWindowImpl(); - return pWindowImpl->mpLastChild; + return pWindowImpl->mpFirstChild; } Window *VclBin::get_child() @@ -546,7 +546,7 @@ Size VclFrame::calculateRequisition() const WindowImpl* pWindowImpl = ImplGetWindowImpl(); const Window *pChild = get_child(); - const Window *pLabel = pChild != pWindowImpl->mpFirstChild ? pWindowImpl->mpFirstChild : NULL; + const Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL; if (pChild && pChild->IsVisible()) aRet = pChild->GetOptimalSize(WINDOWSIZE_PREFERRED); @@ -578,7 +578,7 @@ void VclFrame::setAllocation(const Size &rAllocation) //The label widget is the last (of two) children Window *pChild = get_child(); - Window *pLabel = pChild != pWindowImpl->mpFirstChild ? pWindowImpl->mpFirstChild : NULL; + Window *pLabel = pChild != pWindowImpl->mpLastChild ? pWindowImpl->mpLastChild : NULL; if (pLabel && pLabel->IsVisible()) { |