diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-11-03 15:10:04 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-03 16:00:36 +0100 |
commit | 4284f618557992fdf12574f8fd014be76ec9fffc (patch) | |
tree | fac74828b9a4139d1f74087443c3fcc0b8a1363f /sw/source/filter/ww8/ww8par6.cxx | |
parent | f575cf3320684efe7db9844da89a5ebdb3083498 (diff) |
Simplify containers iterations in sw/source/filter
Use range-based loop or replace with STL functions.
Change-Id: Ifffb7ba08b3a9950ee076558ec4048b0788a38c8
Reviewed-on: https://gerrit.libreoffice.org/62806
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/ww8par6.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index f240b8ffe969..b422202e14e3 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -663,12 +663,10 @@ SwSectionFormat *wwSectionManager::InsertSection( return nullptr; SwPageDesc *pPage = nullptr; - auto aEnd = maSegments.rend(); - for (auto aIter = maSegments.rbegin(); aIter != aEnd; ++aIter) - { - if (nullptr != (pPage = aIter->mpPage)) - break; - } + auto aIter = std::find_if(maSegments.rbegin(), maSegments.rend(), + [](const wwSection& rSegment) { return rSegment.mpPage != nullptr; }); + if (aIter != maSegments.rend()) + pPage = aIter->mpPage; OSL_ENSURE(pPage, "no page outside this section!"); |