diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-01 20:14:27 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-01 20:48:52 +0200 |
commit | afa1e9952eab0310ee3c194ebd03e0b0fe941168 (patch) | |
tree | e48e3266f940df0734ccff5629f3bce1805dec41 /chart2 | |
parent | 9b40d14eb91573e62bdd8a6b9157f623a8c4cf7f (diff) |
some little code clean-up
#
Change-Id: Ifbb754ce7ebe34b69a803f88b02a1e31bd21248f
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/tools/InternalDataProvider.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 647904049d4a..3a4303b08528 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -276,16 +276,14 @@ public: void operator() ( vector< uno::Any >& rVector ) { - if( m_nLevel > static_cast< sal_Int32 >(rVector.size()) ) - rVector.resize( m_nLevel ); - - vector< uno::Any >::iterator aIt( rVector.begin() ); - for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++) + if( m_nLevel >= static_cast< sal_Int32 >(rVector.size()) ) { - if( nN==m_nLevel ) - break; + rVector.resize( m_nLevel + 1 ); + } + else + { + rVector.insert( rVector.begin() + m_nLevel, uno::Any() ); } - rVector.insert( aIt, uno::Any() ); } private: @@ -301,14 +299,9 @@ public: void operator() ( vector< uno::Any >& rVector ) { - vector< uno::Any >::iterator aIt( rVector.begin() ); - for( sal_Int32 nN=0; aIt<rVector.end(); aIt++, nN++) + if( m_nLevel < static_cast<sal_Int32>(rVector.size()) ) { - if( nN==m_nLevel ) - { - rVector.erase( aIt ); - break; - } + rVector.erase(rVector.begin() + m_nLevel); } } |