summaryrefslogtreecommitdiff
path: root/vcl/source/control/button.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-30 10:25:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:19 +0100
commit0d7cbdbeac23b6a04b4b7b6e8fd39f2a99da0f41 (patch)
treec74fa047782a141306fcead918a486933fdfc7e1 /vcl/source/control/button.cxx
parent8f256819b14044afce7e8cf44fbecbe1cb8cb4cf (diff)
just return a vector rather than pass one in by ref to be cleared
Diffstat (limited to 'vcl/source/control/button.cxx')
-rw-r--r--vcl/source/control/button.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 93b4065a3e5e..e49debd5e831 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2316,25 +2316,24 @@ void RadioButton::group(RadioButton &rOther)
// .-----------------------------------------------------------------------
-void RadioButton::GetRadioButtonGroup( std::vector< RadioButton* >& io_rGroup, bool bIncludeThis ) const
+std::vector< RadioButton* > RadioButton::GetRadioButtonGroup(bool bIncludeThis) const
{
- // empty the list
- io_rGroup.clear();
+ std::vector< RadioButton* > aGroup;
if (m_xGroup)
{
for (std::set<RadioButton*>::iterator aI = m_xGroup->begin(), aEnd = m_xGroup->end(); aI != aEnd; ++aI)
{
RadioButton *pRadioButton = *aI;
- if (pRadioButton == this)
+ if (!bIncludeThis && pRadioButton == this)
continue;
- io_rGroup.push_back(pRadioButton);
+ aGroup.push_back(pRadioButton);
}
- return;
+ return aGroup;
}
//old-school
- SAL_WARN("vcl", "No group set on radiobutton");
+ SAL_WARN("vcl", "No new-style group set on radiobutton, using old-style digging around");
// go back to first in group;
Window* pFirst = const_cast<RadioButton*>(this);
@@ -2352,10 +2351,12 @@ void RadioButton::GetRadioButtonGroup( std::vector< RadioButton* >& io_rGroup, b
if( pFirst->GetType() == WINDOW_RADIOBUTTON )
{
if( pFirst != this || bIncludeThis )
- io_rGroup.push_back( static_cast<RadioButton*>(pFirst) );
+ aGroup.push_back( static_cast<RadioButton*>(pFirst) );
}
pFirst = pFirst->GetWindow( WINDOW_NEXT );
} while( pFirst && ( ( pFirst->GetStyle() & WB_GROUP ) == 0 ) );
+
+ return aGroup;
}
// -----------------------------------------------------------------------
@@ -2364,8 +2365,7 @@ void RadioButton::ImplUncheckAllOther()
{
mpWindowImpl->mnStyle |= WB_TABSTOP;
- std::vector<RadioButton*> aGroup;
- GetRadioButtonGroup(aGroup, false);
+ std::vector<RadioButton*> aGroup(GetRadioButtonGroup(false));
// iterate over radio button group and checked buttons
for (std::vector<RadioButton*>::iterator aI = aGroup.begin(), aEnd = aGroup.end(); aI != aEnd; ++aI)
{