diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-21 14:52:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-21 14:53:12 +0000 |
commit | 19c54819a9d8f03788a97ecd4296093f72643069 (patch) | |
tree | 6038b710591bef7e27b8f2694c256e9ec43d5531 /vcl | |
parent | eae732641ff2a60bb5bc50e60f8404aae7a7decb (diff) |
apply packing properties of pseudo-scrolledwindow to self-scrolling child
Change-Id: I13b0b625109237a0ec9711ed2efdc34cd3e0d32b
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/builder.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index 796f33f3f2da..e350a81299d0 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -125,7 +125,7 @@ private: std::vector<ButtonImageWidgetMap> m_aButtonImageWidgetMaps; StockMap m_aStockMap; Translations m_aTranslations; - std::set<Window*> m_aRedundantParentWidgets; + std::map<Window*, Window*> m_aRedundantParentWidgets; }; void loadTranslations(const com::sun::star::lang::Locale &rLocale, const OUString &rUri); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 76ee4ad0c202..e2fcca66d36c 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -224,10 +224,10 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri //Remove ScrollWindow parent widgets whose children in vcl implement scrolling //internally. - for (std::set<Window*>::iterator aI = m_pParserState->m_aRedundantParentWidgets.begin(), + for (std::map<Window*, Window*>::iterator aI = m_pParserState->m_aRedundantParentWidgets.begin(), aEnd = m_pParserState->m_aRedundantParentWidgets.end(); aI != aEnd; ++aI) { - delete_by_window(*aI); + delete_by_window(aI->first); } //drop maps, etc. that we don't need again @@ -795,23 +795,28 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri //so if it appears as a child of a scrolling window //shoehorn that scrolling settings to this //widget and remove the parent + Window *pScrollParent = NULL; if (pParent && pParent->GetType() == WINDOW_SCROLLWINDOW) { WinBits nScrollBits = pParent->GetStyle(); nScrollBits &= (WB_AUTOHSCROLL|WB_HSCROLL|WB_AUTOVSCROLL|WB_VSCROLL); nWinStyle |= nScrollBits; - Window *pScrollParent = pParent; + pScrollParent = pParent; pParent = pParent->GetParent(); + } + + pWindow = new VclMultiLineEdit(pParent, nWinStyle); + if (pScrollParent) + { sal_Int32 nWidthReq = pScrollParent->get_width_request(); rMap[OString("width-request")] = OString::valueOf(nWidthReq); sal_Int32 nHeightReq = pScrollParent->get_height_request(); rMap[OString("height-request")] = OString::valueOf(nHeightReq); - m_pParserState->m_aRedundantParentWidgets.insert(pScrollParent); + m_pParserState->m_aRedundantParentWidgets[pScrollParent] = pWindow; } - pWindow = new VclMultiLineEdit(pParent, nWinStyle); } else { @@ -1446,6 +1451,12 @@ void VclBuilder::applyPackingProperty(Window *pCurrent, xmlreader::Span name; int nsId; + if (pCurrent->GetType() == WINDOW_SCROLLWINDOW) + { + pCurrent = m_pParserState->m_aRedundantParentWidgets[pCurrent]; + assert(pCurrent); + } + while (reader.nextAttribute(&nsId, &name)) { if (name.equals(RTL_CONSTASCII_STRINGPARAM("name"))) |