diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-29 15:42:08 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-12-03 11:34:47 +0200 |
commit | c5ee41058193d346665bda092b8f692e2ecd43d5 (patch) | |
tree | daf289f797c77837df15f35f22f932b995f3408e | |
parent | 418b5df94b5a06ba4c18a82f9ff7a0c215a2060b (diff) |
simplify logic in ScFuncDesc::getFormula
Change-Id: I05fd812d1fd76e57d5305d859b2ad64d471adfb1
-rw-r--r-- | sc/source/core/data/funcdesc.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index e59249af5635..f93fe0c3b156 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -242,23 +242,17 @@ OUString ScFuncDesc::getFormula( const ::std::vector< OUString >& _aArguments ) aFormula.append( *pFuncName ); aFormula.appendAscii( "(" ); - ::std::vector< OUString >::const_iterator aIter = _aArguments.begin(); - ::std::vector< OUString >::const_iterator aEnd = _aArguments.end(); - - if ( nArgCount > 0 && aIter != aEnd ) + if ( nArgCount > 0 && !_aArguments.empty() && !_aArguments[0].isEmpty()) { - bool bLastArg = aIter->isEmpty(); + ::std::vector< OUString >::const_iterator aIter = _aArguments.begin(); + ::std::vector< OUString >::const_iterator aEnd = _aArguments.end(); - while( aIter != aEnd && !bLastArg ) + aFormula.append( *aIter ); + ++aIter; + while( aIter != aEnd && !aIter->isEmpty() ) { - aFormula.append( *(aIter) ); - if ( aIter != (aEnd-1) ) - { - bLastArg = (aIter+1)->isEmpty(); - if ( !bLastArg ) - aFormula.append( sep ); - } - + aFormula.append( sep ); + aFormula.append( *aIter ); ++aIter; } } |