Kaydet (Commit) 6e01306e authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Michael Stahl

svtools: simplify code by replacing std::find_if with std::any_of

... or std::none_of.

Change-Id: Ib6af7f32d9495eca03e29dcea06ff3925b1cc7b7
Reviewed-on: https://gerrit.libreoffice.org/15839Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 73116917
......@@ -1795,15 +1795,8 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
bDelete = true;
else
{
// search for the first filter which matches
::std::vector< WildCard >::const_iterator pMatchingFilter =
::std::find_if(
aFilters.begin(),
aFilters.end(),
FilterMatch( sCompareString )
);
bDelete = aFilters.end() == pMatchingFilter;
bDelete = ::std::none_of( aFilters.begin(), aFilters.end(),
FilterMatch( sCompareString ) );
}
if( bDelete )
......
......@@ -241,14 +241,9 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl )
{
OUString sUpperURL( sURL.toAsciiUpperCase() );
::std::vector< WildCard >::const_iterator aMatchingFilter =
::std::find_if(
pBox->pImp->m_aFilters.begin(),
if ( ::std::none_of( pBox->pImp->m_aFilters.begin(),
pBox->pImp->m_aFilters.end(),
FilterMatch( sUpperURL )
);
if ( aMatchingFilter == pBox->pImp->m_aFilters.end() )
FilterMatch( sUpperURL ) ) )
{ // this URL is not allowed
bValidCompletionsFiltered = true;
continue;
......@@ -988,12 +983,9 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
OUString aUpperURL( aURL );
aUpperURL = aUpperURL.toAsciiUpperCase();
bFound
= (::std::find_if(
pImp->m_aFilters.begin(),
bFound = ::std::any_of(pImp->m_aFilters.begin(),
pImp->m_aFilters.end(),
FilterMatch( aUpperURL ) )
!= pImp->m_aFilters.end());
FilterMatch( aUpperURL ) );
}
if ( bFound )
{
......
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