Replace find_if with proper quantifier algorithms
Missed in 085269d25a
Change-Id: I3cfab57232908b48d090658e0fbc948d62b3fc6f
Reviewed-on: https://gerrit.libreoffice.org/60180
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
b678dee6a8
commit
97b6fd8e9e
@@ -880,10 +880,9 @@ bool ImplicitBoolConversion::VisitImplicitCastExpr(
|
||||
&& !calls.empty())
|
||||
{
|
||||
CallExpr const * call = calls.top();
|
||||
if (std::find_if(
|
||||
if (std::any_of(
|
||||
call->arg_begin(), call->arg_end(),
|
||||
[expr](Expr const * e) { return expr == e->IgnoreParens(); })
|
||||
!= call->arg_end())
|
||||
[expr](Expr const * e) { return expr == e->IgnoreParens(); }))
|
||||
{
|
||||
report(
|
||||
DiagnosticsEngine::Warning,
|
||||
|
||||
@@ -284,13 +284,9 @@ void SvxCharacterMap::updateRecentCharControl()
|
||||
|
||||
void SvxCharacterMap::updateRecentCharacterList(const OUString& sTitle, const OUString& rFont)
|
||||
{
|
||||
auto itChar = std::find_if(maRecentCharList.begin(),
|
||||
maRecentCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
auto itChar = std::find(maRecentCharList.begin(), maRecentCharList.end(), sTitle);
|
||||
|
||||
auto itChar2 = std::find_if(maRecentCharFontList.begin(),
|
||||
maRecentCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
auto itChar2 = std::find(maRecentCharFontList.begin(), maRecentCharFontList.end(), rFont);
|
||||
|
||||
// if recent char to be added is already in list, remove it
|
||||
if( itChar != maRecentCharList.end() && itChar2 != maRecentCharFontList.end() )
|
||||
@@ -328,13 +324,9 @@ void SvxCharacterMap::updateRecentCharacterList(const OUString& sTitle, const OU
|
||||
|
||||
void SvxCharacterMap::updateFavCharacterList(const OUString& sTitle, const OUString& rFont)
|
||||
{
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
|
||||
|
||||
// if Fav char to be added is already in list, remove it
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
@@ -393,13 +385,9 @@ void SvxCharacterMap::updateFavCharControl()
|
||||
|
||||
void SvxCharacterMap::deleteFavCharacterFromList(const OUString& sTitle, const OUString& rFont)
|
||||
{
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
|
||||
|
||||
// if Fav char to be added is already in list, remove it
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
@@ -543,19 +531,16 @@ void SvxCharacterMap::init()
|
||||
|
||||
bool SvxCharacterMap::isFavChar(const OUString& sTitle, const OUString& rFont)
|
||||
{
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
auto isFavCharTitleExists = std::any_of(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
auto isFavCharFontExists = std::any_of(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
|
||||
// if Fav char to be added is already in list, remove it
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return isFavCharTitleExists && isFavCharFontExists;
|
||||
}
|
||||
|
||||
|
||||
@@ -763,15 +748,10 @@ IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl, weld::ComboBoxText&, void)
|
||||
IMPL_LINK(SvxCharacterMap, RecentClearClickHdl, SvxCharView*, rView, void)
|
||||
{
|
||||
OUString sTitle = rView->GetText();
|
||||
auto itChar = std::find_if(maRecentCharList.begin(),
|
||||
maRecentCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
auto itChar = std::find(maRecentCharList.begin(), maRecentCharList.end(), sTitle);
|
||||
|
||||
OUString sFont = rView->GetFont().GetFamilyName();
|
||||
auto itChar2 = std::find_if(maRecentCharFontList.begin(),
|
||||
maRecentCharFontList.end(),
|
||||
[sFont] (const OUString & a)
|
||||
{ return a == sFont; });
|
||||
auto itChar2 = std::find(maRecentCharFontList.begin(), maRecentCharFontList.end(), sFont);
|
||||
|
||||
// if recent char to be added is already in list, remove it
|
||||
if( itChar != maRecentCharList.end() && itChar2 != maRecentCharFontList.end() )
|
||||
|
||||
@@ -891,20 +891,15 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( )
|
||||
|
||||
OUString sRealName;
|
||||
xProp->getPropertyValue(PROPERTY_REALNAME) >>= sRealName;
|
||||
std::vector< OUString>::const_iterator aFindName;
|
||||
if ( sColumnName.isEmpty() )
|
||||
xProp->getPropertyValue(PROPERTY_NAME) >>= sColumnName;
|
||||
|
||||
aFindName = std::find_if(aNames.begin(),aNames.end(),
|
||||
[&aCaseCompare, &sColumnName](const OUString& lhs)
|
||||
{ return aCaseCompare(lhs, sColumnName); } );
|
||||
sal_Int32 j = 0;
|
||||
while ( aFindName != aNames.end() )
|
||||
while ( std::any_of(aNames.begin(),aNames.end(),
|
||||
[&aCaseCompare, &sColumnName](const OUString& lhs)
|
||||
{ return aCaseCompare(lhs, sColumnName); } ) )
|
||||
{
|
||||
sColumnName += OUString::number(++j);
|
||||
aFindName = std::find_if(aNames.begin(),aNames.end(),
|
||||
[&aCaseCompare, &sColumnName](const OUString& lhs)
|
||||
{ return aCaseCompare(lhs, sColumnName); } );
|
||||
}
|
||||
|
||||
pColumn->setName(sColumnName);
|
||||
|
||||
@@ -463,9 +463,8 @@ namespace frm
|
||||
// #i27024#
|
||||
const Any* pSelectSequenceValue = nullptr;
|
||||
|
||||
const OUString* pSelectedItemsPos = ::std::find_if(
|
||||
_rPropertyNames.begin(), _rPropertyNames.end(),
|
||||
[](OUString const & s) { return s == PROPERTY_SELECT_SEQ; }
|
||||
const OUString* pSelectedItemsPos = std::find(
|
||||
_rPropertyNames.begin(), _rPropertyNames.end(), PROPERTY_SELECT_SEQ
|
||||
);
|
||||
auto aStringItemListExists = std::any_of(
|
||||
_rPropertyNames.begin(), _rPropertyNames.end(),
|
||||
|
||||
@@ -115,10 +115,10 @@ namespace frm
|
||||
|
||||
void RichTextEngine::revokeEngineStatusListener( IEngineStatusListener const * _pListener )
|
||||
{
|
||||
::std::vector< IEngineStatusListener* >::iterator aPos = ::std::find_if(
|
||||
::std::vector< IEngineStatusListener* >::iterator aPos = ::std::find(
|
||||
m_aStatusListeners.begin(),
|
||||
m_aStatusListeners.end(),
|
||||
[_pListener](IEngineStatusListener * p) { return p == _pListener; }
|
||||
_pListener
|
||||
);
|
||||
OSL_ENSURE( aPos != m_aStatusListeners.end(), "RichTextEngine::revokeEngineStatusListener: listener not registered!" );
|
||||
if ( aPos != m_aStatusListeners.end() )
|
||||
|
||||
@@ -213,7 +213,7 @@ void recentUnoChanged( GtkWidget* pSelector, gpointer /* pItem */ )
|
||||
static void addToRecentUnoCommands(GtvApplicationWindow* pWindow, const std::string& rUnoCmd, std::string rArgs)
|
||||
{
|
||||
GtvMainToolbar* pToolbar = gtv_application_window_get_main_toolbar(pWindow);
|
||||
rArgs.erase(std::find_if(rArgs.begin(), rArgs.end(), [](char ch) { return ch == '\n'; }));
|
||||
rArgs.erase(std::find(rArgs.begin(), rArgs.end(), '\n'));
|
||||
const std::string rUnoCmdStr = rUnoCmd + " | " + rArgs;
|
||||
|
||||
|
||||
|
||||
@@ -276,13 +276,8 @@ void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const OUStri
|
||||
{
|
||||
if(isFavChar(sTitle, rFont))
|
||||
{
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
|
||||
auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
|
||||
|
||||
// if Fav char to be added is already in list, remove it
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
@@ -307,13 +302,8 @@ void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const OUStri
|
||||
return;
|
||||
}
|
||||
|
||||
auto itChar = std::find_if(maFavCharList.begin(),
|
||||
maFavCharList.end(),
|
||||
[sTitle] (const OUString & a) { return a == sTitle; });
|
||||
|
||||
auto itChar2 = std::find_if(maFavCharFontList.begin(),
|
||||
maFavCharFontList.end(),
|
||||
[rFont] (const OUString & a) { return a == rFont; });
|
||||
auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), sTitle);
|
||||
auto itChar2 = std::find(maFavCharFontList.begin(), maFavCharFontList.end(), rFont);
|
||||
|
||||
// if Fav char to be added is already in list, remove it
|
||||
if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
|
||||
|
||||
@@ -251,15 +251,7 @@ bool FormCellBindingHelper::isSpreadsheetDocumentWhichSupplies( const Reference<
|
||||
if ( xDocumentFactory.is() )
|
||||
aAvailableServices = xDocumentFactory->getAvailableServiceNames( );
|
||||
|
||||
const OUString* pFound = ::std::find_if(
|
||||
aAvailableServices.begin(),
|
||||
aAvailableServices.end(),
|
||||
StringCompare( _rService )
|
||||
);
|
||||
if ( pFound - aAvailableServices.getConstArray() < aAvailableServices.getLength() )
|
||||
{
|
||||
bYesItIs = true;
|
||||
}
|
||||
bYesItIs = std::any_of( aAvailableServices.begin(), aAvailableServices.end(), StringCompare( _rService ) );
|
||||
}
|
||||
}
|
||||
catch( const Exception& )
|
||||
|
||||
Reference in New Issue
Block a user