summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-08-29 00:47:33 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 11:40:29 +0200
commit085269d25a705b656436feac47149296b4b4b35d (patch)
tree3195c0526652ebd9e125507aa17cd15b2acfb368 /svx
parentb0e74b65a86eb965c3e93da2fb77972cc5445f3c (diff)
Replace find_if with proper quantifier algorithms
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/ClassificationCommon.cxx5
-rw-r--r--svx/source/dialog/charmap.cxx9
-rw-r--r--svx/source/items/customshapeitem.cxx4
3 files changed, 7 insertions, 11 deletions
diff --git a/svx/source/dialog/ClassificationCommon.cxx b/svx/source/dialog/ClassificationCommon.cxx
index cd5dc7324d02..082b5b6a9418 100644
--- a/svx/source/dialog/ClassificationCommon.cxx
+++ b/svx/source/dialog/ClassificationCommon.cxx
@@ -58,9 +58,8 @@ OUString getProperty(uno::Reference<beans::XPropertyContainer> const& rxProperty
bool containsProperty(uno::Sequence<beans::Property> const& rProperties, OUString const& rName)
{
- return std::find_if(rProperties.begin(), rProperties.end(),
- [&](const beans::Property& rProperty) { return rProperty.Name == rName; })
- != rProperties.end();
+ return std::any_of(rProperties.begin(), rProperties.end(),
+ [&](const beans::Property& rProperty) { return rProperty.Name == rName; });
}
void removeAllProperties(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer)
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 20d5cc11bd4f..0e8f30204fcb 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -204,19 +204,16 @@ void SvxShowCharSet::getFavCharacterList()
bool SvxShowCharSet::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, return true
- if( itChar != maFavCharList.end() && itChar2 != maFavCharFontList.end() )
- return true;
- else
- return false;
+ return isFavCharTitleExists && isFavCharFontExists;
}
void SvxShowCharSet::createContextMenu()
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index ffd6c514c64f..f19937113b82 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -141,7 +141,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyVal
}
else
{ // it's a new property
- assert(aPropSeq.end() == std::find_if(aPropSeq.begin(), aPropSeq.end(),
+ assert(std::none_of(aPropSeq.begin(), aPropSeq.end(),
[&rPropVal](beans::PropertyValue const& rVal)
{ return rVal.Name == rPropVal.Name; } ));
sal_uInt32 nIndex = aPropSeq.getLength();
@@ -167,7 +167,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const OUString& rSequenceName
aValue.Name = rSequenceName;
aValue.Value <<= aSeq;
- assert(aPropSeq.end() == std::find_if(aPropSeq.begin(), aPropSeq.end(),
+ assert(std::none_of(aPropSeq.begin(), aPropSeq.end(),
[&rSequenceName](beans::PropertyValue const& rV)
{ return rV.Name == rSequenceName; } ));
sal_uInt32 nIndex = aPropSeq.getLength();