Kaydet (Commit) cf5fbc12 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

try to limit the getPropertyValue calls

Change-Id: I70b7a3b5f508ecb89d4e4e43cc4297805e83c9f7
üst 02b73e77
...@@ -80,6 +80,27 @@ void PropertyMapper::getValueMap( ...@@ -80,6 +80,27 @@ void PropertyMapper::getValueMap(
tPropertyNameMap::const_iterator aIt( rNameMap.begin() ); tPropertyNameMap::const_iterator aIt( rNameMap.begin() );
tPropertyNameMap::const_iterator aEnd( rNameMap.end() ); tPropertyNameMap::const_iterator aEnd( rNameMap.end() );
uno::Reference< beans::XMultiPropertySet > xMultiPropSet(xSourceProp, uno::UNO_QUERY);
if(xMultiPropSet.is())
{
uno::Sequence< rtl::OUString > aPropSourceNames(rNameMap.size());
uno::Sequence< rtl::OUString > aPropTargetNames(rNameMap.size());
for(sal_Int32 i = 0; aIt != aEnd; ++aIt, ++i)
{
aPropSourceNames[i] = aIt->first;
aPropTargetNames[i] = aIt->second;
}
uno::Sequence< uno::Any > xValues = xMultiPropSet->getPropertyValues(aPropSourceNames);
for(sal_Int32 i = 0, n = rNameMap.size(); i < n; ++i)
{
if( xValues[i].hasValue() )
rValueMap.insert( tPropertyNameValueMap::value_type( aPropTargetNames[i], xValues[i] ) );
}
}
else
{
for( ; aIt != aEnd; ++aIt ) for( ; aIt != aEnd; ++aIt )
{ {
OUString aTarget = aIt->first; OUString aTarget = aIt->first;
...@@ -95,6 +116,7 @@ void PropertyMapper::getValueMap( ...@@ -95,6 +116,7 @@ void PropertyMapper::getValueMap(
ASSERT_EXCEPTION( e ); ASSERT_EXCEPTION( e );
} }
} }
}
} }
void PropertyMapper::getMultiPropertyLists( void PropertyMapper::getMultiPropertyLists(
......
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