summaryrefslogtreecommitdiff
path: root/vcl/source/control/button.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-22 13:58:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:20 +0100
commit8d34fae6ebf37677109dfd4cd5343e5b96456e04 (patch)
tree1e362c6e19e71a4bd2bfd147794b682862e43368 /vcl/source/control/button.cxx
parenta983689039321013117a69ac2eba6ecbf85773ac (diff)
fix button groups
Diffstat (limited to 'vcl/source/control/button.cxx')
-rw-r--r--vcl/source/control/button.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index c299f48faef5..d455526a9bf9 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2312,14 +2312,17 @@ void RadioButton::group(RadioButton &rOther)
}
if (rOther.m_xGroup)
- {
- for (std::set<RadioButton*>::iterator aI = rOther.m_xGroup->begin(), aEnd = rOther.m_xGroup->end(); aI != aEnd; ++aI)
- m_xGroup->insert(*aI);
- }
+ m_xGroup->insert(rOther.m_xGroup->begin(), rOther.m_xGroup->end());
m_xGroup->insert(&rOther);
- rOther.m_xGroup = m_xGroup;
+ //make all members of the group share the same button group
+ for (std::set<RadioButton*>::iterator aI = m_xGroup->begin(), aEnd = m_xGroup->end();
+ aI != aEnd; ++aI)
+ {
+ RadioButton* pButton = *aI;
+ pButton->m_xGroup = m_xGroup;
+ }
//if this one is checked, uncheck all the others
if (mbChecked)