From 60846212c7f5271a86fd43555d633f77d59f5a10 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 21 May 2020 09:11:25 +0200 Subject: 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 --- svtools/source/uno/wizard/unowizard.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'svtools') 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()); - if (pPageId != i_rPaths[i].end()) + auto pPageId = std::adjacent_find(rPath.begin(), rPath.end(), std::greater_equal()); + 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 -- cgit