summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/dociter.cxx8
-rw-r--r--sc/source/core/data/dpdimsave.cxx13
-rw-r--r--sc/source/core/data/dpfilteredcache.cxx10
3 files changed, 10 insertions, 21 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 02ae04ccbc81..720bd573b0d0 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -44,6 +44,7 @@
#include <svl/sharedstring.hxx>
#include <unotools/collatorwrapper.hxx>
+#include <algorithm>
#include <vector>
using ::rtl::math::approxEqual;
@@ -732,12 +733,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM
}
// Row is valid as long as there is at least one result being true.
- vector<bool>::const_iterator itr = aResults.begin(), itrEnd = aResults.end();
- for (; itr != itrEnd; ++itr)
- if (*itr)
- return true;
-
- return false;
+ return std::find(aResults.begin(), aResults.end(), true) != aResults.end();
}
ScDBQueryDataIterator::Value::Value() :
diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx
index 2319294b49c5..f2f87aa668e1 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -57,13 +57,12 @@ void ScDPSaveGroupItem::AddElementsFromGroup( const ScDPSaveGroupItem& rGroup )
bool ScDPSaveGroupItem::RemoveElement( const OUString& rName )
{
- for (std::vector<OUString>::iterator aIter = aElements.begin(); aIter != aElements.end(); ++aIter)
- if (*aIter == rName) //TODO: ignore case
- {
- aElements.erase(aIter); // found -> remove
- return true; // don't have to look further
- }
-
+ auto it = std::find(aElements.begin(), aElements.end(), rName); //TODO: ignore case
+ if (it != aElements.end())
+ {
+ aElements.erase(it);
+ return true;
+ }
return false; // not found
}
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index e3f47ffd7fcb..f46c6cd96065 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/diagnose.h>
+#include <algorithm>
using ::std::vector;
using ::com::sun::star::uno::Sequence;
@@ -51,14 +52,7 @@ ScDPFilteredCache::GroupFilter::GroupFilter()
bool ScDPFilteredCache::GroupFilter::match(const ScDPItemData& rCellData) const
{
- vector<ScDPItemData>::const_iterator it = maItems.begin(), itEnd = maItems.end();
- for (; it != itEnd; ++it)
- {
- bool bMatch = *it == rCellData;
- if (bMatch)
- return true;
- }
- return false;
+ return std::find(maItems.begin(), maItems.end(), rCellData) != maItems.end();
}
std::vector<ScDPItemData> ScDPFilteredCache::GroupFilter::getMatchValues() const