diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-01-06 15:02:59 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-07 07:24:05 +0100 |
commit | 892a5cfe557edb405ec0037676f02a1c24dd76ec (patch) | |
tree | bb023d0858cd0f34ded726e2b54933a2481cc6b1 /sc/source/ui/unoobj/datauno.cxx | |
parent | 4cd19e16ce24cd244e3a5a3c23add91a8f980790 (diff) |
Simplify containers iterations in sc/source/ui/{unoobj,vba}
Use range-based loop or replace with STL functions
Change-Id: Ia8a8cfb71047e5612aa62c817c76ae0dfb7b3fa2
Reviewed-on: https://gerrit.libreoffice.org/65903
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/datauno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index a268d9c264db..7bd845b02437 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1275,13 +1275,13 @@ uno::Sequence<sheet::TableFilterField3> SAL_CALL ScFilterDescriptorBase::getFilt const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems(); size_t nItemCount = rItems.size(); aField.Values.realloc(nItemCount); - ScQueryEntry::QueryItemsType::const_iterator itr = rItems.begin(), itrEnd = rItems.end(); - for (size_t j = 0; itr != itrEnd; ++itr, ++j) + size_t j = 0; + for (const auto& rItem : rItems) { - aField.Values[j].IsNumeric = itr->meType != ScQueryEntry::ByString; - aField.Values[j].StringValue = itr->maString.getString(); - aField.Values[j].NumericValue = itr->mfVal; - + aField.Values[j].IsNumeric = rItem.meType != ScQueryEntry::ByString; + aField.Values[j].StringValue = rItem.maString.getString(); + aField.Values[j].NumericValue = rItem.mfVal; + ++j; } } @@ -2277,9 +2277,12 @@ uno::Sequence<OUString> SAL_CALL ScDatabaseRangesObj::getElementNames() { const ScDBCollection::NamedDBs& rDBs = pNames->getNamedDBs(); uno::Sequence<OUString> aSeq(rDBs.size()); - ScDBCollection::NamedDBs::const_iterator itr = rDBs.begin(), itrEnd = rDBs.end(); - for (size_t i = 0; itr != itrEnd; ++itr, ++i) - aSeq[i] = (*itr)->GetName(); + size_t i = 0; + for (const auto& rDB : rDBs) + { + aSeq[i] = rDB->GetName(); + ++i; + } return aSeq; } |