summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx9
1 files changed, 8 insertions, 1 deletions
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<WinAndId>::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;
}