Kaydet (Commit) 4b2c05d4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify iteration over Sequence

Change-Id: I84b79c6cc11a5cd506e22caf294423a3c0b953f0
üst def066bb
...@@ -3353,20 +3353,17 @@ void VBAConstantHelper::init() ...@@ -3353,20 +3353,17 @@ void VBAConstantHelper::init()
} }
aConstCache.push_back( sLeafName ); // assume constant group names are unique aConstCache.push_back( sLeafName ); // assume constant group names are unique
Sequence< Reference< XConstantTypeDescription > > aConsts = xConstants->getConstants(); Sequence< Reference< XConstantTypeDescription > > aConsts = xConstants->getConstants();
Reference< XConstantTypeDescription >* pSrc = aConsts.getArray(); for (sal_Int32 i = 0; i != aConsts.getLength(); ++i)
sal_Int32 nLen = aConsts.getLength();
for ( sal_Int32 index =0; index<nLen; ++pSrc, ++index )
{ {
// store constant member name // store constant member name
Reference< XConstantTypeDescription >& rXConst = *pSrc; sFullName = aConsts[i]->getName();
sFullName = rXConst->getName();
indexLastDot = sFullName.lastIndexOf('.'); indexLastDot = sFullName.lastIndexOf('.');
sLeafName = sFullName; sLeafName = sFullName;
if ( indexLastDot > -1 ) if ( indexLastDot > -1 )
{ {
sLeafName = sFullName.copy( indexLastDot + 1); sLeafName = sFullName.copy( indexLastDot + 1);
} }
aConstHash[ sLeafName.toAsciiLowerCase() ] = rXConst->getConstantValue(); aConstHash[ sLeafName.toAsciiLowerCase() ] = aConsts[i]->getConstantValue();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment