diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 09:11:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 09:54:30 +0200 |
commit | 60846212c7f5271a86fd43555d633f77d59f5a10 (patch) | |
tree | ba3d9464385a2f3abdeea93b1fe887bf385f8463 /svtools | |
parent | 8477bbf8d6867e656b8132f0ddd682d08590a547 (diff) |
use for-range on Sequence in sfx2..sw
Change-Id: I09806869f2fdbae61f4c5d5c9db6859202bb63b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94609
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/uno/wizard/unowizard.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index fb4995c4a99f..ddc87539c66a 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -171,20 +171,22 @@ namespace { throw IllegalArgumentException( OUString(), i_rContext, 2 ); // each path must be of length 1, at least - for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i ) + sal_Int32 i = 0; + for ( const Sequence< sal_Int16 >& rPath : i_rPaths ) { - if ( !i_rPaths[i].hasElements() ) + if ( !rPath.hasElements() ) throw IllegalArgumentException( OUString(), i_rContext, 2 ); // page IDs must be in ascending order - auto pPageId = std::adjacent_find(i_rPaths[i].begin(), i_rPaths[i].end(), std::greater_equal<sal_Int16>()); - if (pPageId != i_rPaths[i].end()) + auto pPageId = std::adjacent_find(rPath.begin(), rPath.end(), std::greater_equal<sal_Int16>()); + if (pPageId != rPath.end()) { throw IllegalArgumentException( "Path " + OUString::number(i) + ": invalid page ID sequence - each page ID must be greater than the previous one.", i_rContext, 2 ); } + ++i; } // if we have one path, that's okay |