summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-07 20:10:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-07 20:11:41 +0000
commitfd5e86090b2708ea318746b6610d7a143859f273 (patch)
tree64a141eaed63f08eac741898bff6b3571f335632 /vcl
parent40078b3ef32a60852f692d6ed222cb767133d7e0 (diff)
tidy up toolbox packing handling
we don't want to apply the children's attributes onto the parent widget Change-Id: Iad31e7f89266633e621aaf597713564747f7cac7
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 0bc7bc36066f..8e86ba7498cc 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2680,14 +2680,16 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
if (!pCurrent)
return;
- ToolBox *pToolBox = NULL;
+ //ToolBoxItems are not true widgets just elements
+ //of the ToolBox itself
+ ToolBox *pToolBoxParent = NULL;
if (pCurrent == pParent)
- pToolBox = dynamic_cast<ToolBox*>(pParent);
+ pToolBoxParent = dynamic_cast<ToolBox*>(pParent);
xmlreader::Span name;
int nsId;
- if (pCurrent && pCurrent->GetType() == WINDOW_SCROLLWINDOW)
+ if (pCurrent->GetType() == WINDOW_SCROLLWINDOW)
{
std::map<Window*, Window*>::iterator aFind = m_pParserState->m_aRedundantParentWidgets.find(pCurrent);
if (aFind != m_pParserState->m_aRedundantParentWidgets.end())
@@ -2711,13 +2713,15 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
if (sKey == "expand")
{
bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1');
- if (pCurrent)
+ if (pToolBoxParent)
+ pToolBoxParent->SetItemExpand(m_pParserState->m_nLastToolbarId, bTrue);
+ else
pCurrent->set_expand(bTrue);
- if (pToolBox)
- pToolBox->SetItemExpand(m_pParserState->m_nLastToolbarId, bTrue);
- continue;
}
+ if (pToolBoxParent)
+ continue;
+
if (sKey == "fill")
{
bool bTrue = (sValue[0] == 't' || sValue[0] == 'T' || sValue[0] == '1');