summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-31 10:01:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-31 10:37:23 +0100
commitd05136ca09494a129ccebf9e26feee64c3195134 (patch)
treef6d5d5ed12fbbe952de2d9921574f16a94bdba6e /cui
parent85cb9084533605657aca0394afe4516058a8e4ef (diff)
use return optimization
Change-Id: I9f56598e238f56b3648ecad6526634a2ee363e5b
Diffstat (limited to 'cui')
-rw-r--r--cui/source/inc/treeopt.hxx4
-rw-r--r--cui/source/options/treeopt.cxx17
2 files changed, 10 insertions, 11 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 38700e684d24..f10e524d6d9d 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -192,9 +192,7 @@ private:
const com::sun::star::uno::Reference<
com::sun::star::frame::XFrame >& xFrame );
Module* LoadModule( const rtl::OUString& rModuleIdentifier );
- void LoadNodes( Module* pModule,
- const rtl::OUString& rExtensionId,
- VectorOfNodes& rOutNodeList );
+ VectorOfNodes LoadNodes( Module* pModule, const rtl::OUString& rExtensionId );
void InsertNodes( const VectorOfNodes& rNodeList );
protected:
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 9db1841150b5..2e4fad190344 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1931,8 +1931,7 @@ void OfaTreeOptionsDialog::LoadExtensionOptions( const rtl::OUString& rExtension
if ( rExtensionId.isEmpty() )
pModule = LoadModule( GetModuleIdentifier( xMSFac, Reference< XFrame >() ) );
- VectorOfNodes aNodeList;
- LoadNodes( pModule, rExtensionId, aNodeList );
+ VectorOfNodes aNodeList = LoadNodes( pModule, rExtensionId );
InsertNodes( aNodeList );
}
@@ -2033,10 +2032,11 @@ Module* OfaTreeOptionsDialog::LoadModule(
return pModule;
}
-void OfaTreeOptionsDialog::LoadNodes(
- Module* pModule, const rtl::OUString& rExtensionId,
- VectorOfNodes& rOutNodeList )
+VectorOfNodes OfaTreeOptionsDialog::LoadNodes(
+ Module* pModule, const rtl::OUString& rExtensionId)
{
+ VectorOfNodes aOutNodeList;
+
Reference< XNameAccess > xSet(
officecfg::Office::OptionsDialog::Nodes::get());
VectorOfNodes aNodeList;
@@ -2148,7 +2148,7 @@ void OfaTreeOptionsDialog::LoadNodes(
// do not insert nodes without leaves
if ( pNode->m_aLeaves.size() > 0 || pNode->m_aGroupedLeaves.size() > 0 )
{
- pModule ? aNodeList.push_back( pNode ) : rOutNodeList.push_back( pNode );
+ pModule ? aNodeList.push_back( pNode ) : aOutNodeList.push_back( pNode );
}
}
}
@@ -2164,7 +2164,7 @@ void OfaTreeOptionsDialog::LoadNodes(
OptionsNode* pNode = aNodeList[j];
if ( pNode->m_sId == sNodeId )
{
- rOutNodeList.push_back( pNode );
+ aOutNodeList.push_back( pNode );
aNodeList.erase( aNodeList.begin() + j );
break;
}
@@ -2172,8 +2172,9 @@ void OfaTreeOptionsDialog::LoadNodes(
}
for ( i = 0; i < aNodeList.size(); ++i )
- rOutNodeList.push_back( aNodeList[i] );
+ aOutNodeList.push_back( aNodeList[i] );
}
+ return aOutNodeList;
}
sal_uInt16 lcl_getGroupId( const rtl::OUString& rGroupName, const SvTreeListBox& rTreeLB )