From c648d4287877f62554cb4f940d565833fb46a2b3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 16 Oct 2012 10:29:01 +0100 Subject: annoying border/child window confusion Change-Id: I6ab919ff326a8525d1bed7db6474764de4e5bcf0 --- vcl/source/window/builder.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 5e66858a33d3..073be0d802c1 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1569,10 +1569,17 @@ OString VclBuilder::get_by_window(const Window *pWindow) const sal_Int32 VclBuilder::get_window_packing_position(const Window *pWindow) const { + //We've stored the return of new Control, some of these get + //border windows placed around them which are what you get + //from GetChild, so scoot up a level if necessary to get the + //window whose position value we have + const Window *pPropHolder = pWindow->mpWindowImpl->mpClientWindow ? + pWindow->mpWindowImpl->mpClientWindow : pWindow; + for (std::vector::const_iterator aI = m_aChildren.begin(), aEnd = m_aChildren.end(); aI != aEnd; ++aI) { - if (aI->m_pWindow == pWindow) + if (aI->m_pWindow == pPropHolder) return aI->m_nPosition; } -- cgit