Kaydet (Commit) 2f0c10db authored tarafından Jochen Nitschke's avatar Jochen Nitschke

simplify strip types from Sequence, related tdf#108782

Change-Id: Ia8bd4ead67183e7f56c804e949ac04c6451c5201
Reviewed-on: https://gerrit.libreoffice.org/39809Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJochen Nitschke <j.nitschke+logerrit@ok.de>
üst b533b274
......@@ -263,14 +263,10 @@ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( )
OSL_PRECOND( !!m_aDocScriptSupport, "SbaTableQueryBrowser::getTypes: did not initialize this, yet!" );
if ( !m_aDocScriptSupport || !*m_aDocScriptSupport )
{
Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 );
std::remove_copy_if(
aTypes.begin(),
aTypes.end(),
aStrippedTypes.getArray(),
std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XScriptInvocationContext>::get() )
);
aTypes = aStrippedTypes;
auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
[](const Type& type)
{ return type == cppu::UnoType<XScriptInvocationContext>::get(); } );
aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
}
return aTypes;
}
......
......@@ -226,15 +226,11 @@ namespace dbaui
Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() );
if ( !m_pImpl->documentHasScriptSupport() )
{
Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 );
std::remove_copy_if(
aTypes.begin(),
aTypes.end(),
aStrippedTypes.getArray(),
std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XScriptInvocationContext>::get() )
);
aTypes = aStrippedTypes;
}
auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(),
[](const Type& type)
{ return type == cppu::UnoType<XScriptInvocationContext>::get(); } );
aTypes.realloc( std::distance(aTypes.begin(), newEnd) );
}
return aTypes;
}
......
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