diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-07 21:27:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:25 +0100 |
commit | 5bd141f37c67c167159901243300df659b3149d7 (patch) | |
tree | eb64541a40bb4b326ac8ab14696a640e1aa051a8 | |
parent | a498ac81ae4e79e61a55432f12962c69bdf116ca (diff) |
There can be more than one toplevel object in a .ui file
-rw-r--r-- | vcl/source/window/builder.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index f4541efed402..578f6e99fcc6 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -251,7 +251,6 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const { fprintf(stderr, "for %s, created %p child of %p (%p/%p/%p)\n", name.getStr(), pWindow, pParent, pWindow->mpWindowImpl->mpParent, pWindow->mpWindowImpl->mpRealParent, pWindow->mpWindowImpl->mpBorderWindow); m_aChildren.push_back(WinAndId(id, pWindow)); - m_aParentTypes.push(name); } return pWindow; } @@ -276,6 +275,7 @@ Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, co if (pCurrentChild) { + m_aParentTypes.push(rClass); for (stringmap::iterator aI = rMap.begin(), aEnd = rMap.end(); aI != aEnd; ++aI) { const rtl::OString &rKey = aI->first; @@ -408,7 +408,7 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) if (pCurrentChild) { //Select the first page if its a notebook - if (m_aParentTypes.top().equalsL(RTL_CONSTASCII_STRINGPARAM("GtkNotebook"))) + if (!m_aParentTypes.empty() && m_aParentTypes.top().equalsL(RTL_CONSTASCII_STRINGPARAM("GtkNotebook"))) { TabControl *pTabControl = static_cast<TabControl*>(pCurrentChild); pTabControl->SetCurPageId(1); @@ -450,7 +450,8 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader) #endif } - m_aParentTypes.pop(); + if (!m_aParentTypes.empty()) + m_aParentTypes.pop(); } } else if (name.equals(RTL_CONSTASCII_STRINGPARAM("packing"))) |