summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk/unopkg
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 08:43:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-20 12:11:11 +0200
commit1553d3787cbe0cdababf31382bf3376a3640d8cf (patch)
treeb829cc1f97dac33abdf1e592a636d6fb24497f13 /desktop/source/pkgchk/unopkg
parentc2ead5a142be19cb74127294641ec35da9e0f5c5 (diff)
use for-range on Sequence in d*
and fix bug in GenericClipboard::initialize, where it was looping through the arguments, but always reading the first one. I'm guessing it was never an issue because it is always called with only one argument Change-Id: I8f72b6bce8c77a69c7d75115e34630e2c308261e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94553 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source/pkgchk/unopkg')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 8532366885c0..6c9f8ce00bae 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -164,15 +164,15 @@ Reference<deployment::XPackage> findPackage(
Reference<ucb::XCommandEnvironment > const & environment,
OUString const & idOrFileName )
{
- Sequence< Reference<deployment::XPackage> > ps(
+ const Sequence< Reference<deployment::XPackage> > ps(
manager->getDeployedExtensions(repository,
Reference<task::XAbortChannel>(), environment ) );
- for ( sal_Int32 i = 0; i < ps.getLength(); ++i )
- if ( dp_misc::getIdentifier( ps[i] ) == idOrFileName )
- return ps[i];
- for ( sal_Int32 i = 0; i < ps.getLength(); ++i )
- if ( ps[i]->getName() == idOrFileName )
- return ps[i];
+ for ( auto const & package : ps )
+ if ( dp_misc::getIdentifier( package ) == idOrFileName )
+ return package;
+ for ( auto const & package : ps )
+ if ( package->getName() == idOrFileName )
+ return package;
return Reference<deployment::XPackage>();
}