diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 08:43:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-20 12:11:11 +0200 |
commit | 1553d3787cbe0cdababf31382bf3376a3640d8cf (patch) | |
tree | b829cc1f97dac33abdf1e592a636d6fb24497f13 /desktop/source/app/dispatchwatcher.cxx | |
parent | c2ead5a142be19cb74127294641ec35da9e0f5c5 (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/app/dispatchwatcher.cxx')
-rw-r--r-- | desktop/source/app/dispatchwatcher.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 5bf047d591cf..450fd0e1e207 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -188,21 +188,21 @@ void scriptCat(const Reference< XModel >& xDoc ) return; } - Sequence< OUString > aLibNames = xLibraries->getElementNames(); + const Sequence< OUString > aLibNames = xLibraries->getElementNames(); std::cout << "Libraries: " << aLibNames.getLength() << "\n"; - for ( sal_Int32 i = 0 ; i < aLibNames.getLength() ; ++i ) + for (OUString const & libName : aLibNames) { - std::cout << "Library: '" << aLibNames[i] << "' children: "; + std::cout << "Library: '" << libName << "' children: "; Reference< XNameContainer > xContainer; try { - if (!xLibraries->isLibraryLoaded( aLibNames[i] )) - xLibraries->loadLibrary( aLibNames[i] ); + if (!xLibraries->isLibraryLoaded( libName )) + xLibraries->loadLibrary( libName ); xContainer = Reference< XNameContainer >( - xLibraries->getByName( aLibNames[i] ), UNO_QUERY ); + xLibraries->getByName( libName ), UNO_QUERY ); } catch (const css::uno::Exception &e) { - std::cout << "[" << aLibNames[i] << "] - failed to load library: " << e.Message << "\n"; + std::cout << "[" << libName << "] - failed to load library: " << e.Message << "\n"; continue; } if( !xContainer.is() ) |