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 ) ...@@ -1795,15 +1795,8 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter )
bDelete = true; bDelete = true;
else else
{ {
// search for the first filter which matches bDelete = ::std::none_of( aFilters.begin(), aFilters.end(),
::std::vector< WildCard >::const_iterator pMatchingFilter = FilterMatch( sCompareString ) );
::std::find_if(
aFilters.begin(),
aFilters.end(),
FilterMatch( sCompareString )
);
bDelete = aFilters.end() == pMatchingFilter;
} }
if( bDelete ) if( bDelete )
......
...@@ -241,14 +241,9 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl ) ...@@ -241,14 +241,9 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl )
{ {
OUString sUpperURL( sURL.toAsciiUpperCase() ); OUString sUpperURL( sURL.toAsciiUpperCase() );
::std::vector< WildCard >::const_iterator aMatchingFilter = if ( ::std::none_of( pBox->pImp->m_aFilters.begin(),
::std::find_if( pBox->pImp->m_aFilters.end(),
pBox->pImp->m_aFilters.begin(), FilterMatch( sUpperURL ) ) )
pBox->pImp->m_aFilters.end(),
FilterMatch( sUpperURL )
);
if ( aMatchingFilter == pBox->pImp->m_aFilters.end() )
{ // this URL is not allowed { // this URL is not allowed
bValidCompletionsFiltered = true; bValidCompletionsFiltered = true;
continue; continue;
...@@ -988,12 +983,9 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() ...@@ -988,12 +983,9 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
OUString aUpperURL( aURL ); OUString aUpperURL( aURL );
aUpperURL = aUpperURL.toAsciiUpperCase(); aUpperURL = aUpperURL.toAsciiUpperCase();
bFound bFound = ::std::any_of(pImp->m_aFilters.begin(),
= (::std::find_if( pImp->m_aFilters.end(),
pImp->m_aFilters.begin(), FilterMatch( aUpperURL ) );
pImp->m_aFilters.end(),
FilterMatch( aUpperURL ) )
!= pImp->m_aFilters.end());
} }
if ( bFound ) 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