summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-05-03 11:30:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-05-03 11:31:40 +0100
commitbfa360c6e761a1e9b3e34665b9b36d724979fdfd (patch)
tree3f4633e563474f6f3ad2e1e6906db637aed29137 /vcl
parentfix bug #60700 - de-crutify ODF files (diff)
downloadcore-bfa360c6e761a1e9b3e34665b9b36d724979fdfd.tar.gz
core-bfa360c6e761a1e9b3e34665b9b36d724979fdfd.zip
unset WB_GROUP on non-initial buttons in groups
Change-Id: I8846318e8d7fef862bb105af878b2df17045d7ff
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx24
-rw-r--r--vcl/source/window/layout.cxx3
2 files changed, 23 insertions, 4 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 362786a33176..cc3919e35e4b 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1580,11 +1580,12 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
aChilds.push_back(pChild);
}
+ bool bIsButtonBox = dynamic_cast<VclButtonBox*>(pCurrentChild) != NULL;
+
//sort child order within parent so that tabbing
//between controls goes in a visually sensible sequence
std::stable_sort(aChilds.begin(), aChilds.end(), sortIntoBestTabTraversalOrder(this));
- for (size_t i = 0; i < aChilds.size(); ++i)
- reorderWithinParent(*aChilds[i], i);
+ reorderWithinParent(aChilds, bIsButtonBox);
}
}
}
@@ -1607,6 +1608,25 @@ void VclBuilder::handleChild(Window *pParent, xmlreader::XmlReader &reader)
}
}
+void VclBuilder::reorderWithinParent(std::vector<Window*>& rChilds, bool bIsButtonBox)
+{
+ for (size_t i = 0; i < rChilds.size(); ++i)
+ {
+ reorderWithinParent(*rChilds[i], i);
+
+ if (!bIsButtonBox)
+ break;
+
+ //The first member of the group for legacy code needs WB_GROUP set and the
+ //others not
+ WinBits nBits = rChilds[i]->GetStyle();
+ nBits &= ~WB_GROUP;
+ if (i == 0)
+ nBits |= WB_GROUP;
+ rChilds[i]->SetStyle(nBits);
+ }
+}
+
void VclBuilder::collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap)
{
xmlreader::Span span;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index d19ffaeba42d..c3935d967e59 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -697,8 +697,7 @@ void VclButtonBox::sort_native_button_order()
//sort child order within parent so that we match the platform
//button order
std::stable_sort(aChilds.begin(), aChilds.end(), sortButtons(m_bVerticalContainer));
- for (size_t i = 0; i < aChilds.size(); ++i)
- VclBuilder::reorderWithinParent(*aChilds[i], i);
+ VclBuilder::reorderWithinParent(aChilds, true);
}
VclGrid::array_type VclGrid::assembleGrid() const