diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-09 23:31:51 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-10 00:15:56 +0200 |
commit | bad6a946b1850a7f9fb4847e0f17b219a90ff200 (patch) | |
tree | 79fc709deab8cd902af1041bb409d20554c9cd74 | |
parent | c63ec2a923b8e06df01593677ca90a271084ca04 (diff) |
Simplify iteration
Change-Id: I0340c47a007e541455d8bf339eaa7d438f5cb10f
Reviewed-on: https://gerrit.libreoffice.org/80570
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 4aae993d5541..70cc871854d6 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -183,24 +183,22 @@ uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rUR { return xPlayer; } - uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext()); if (!pMimeType || *pMimeType == AVMEDIA_MIMETYPE_COMMON) { + uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext()); - static const char * aServiceManagers[] = + static OUStringLiteral aServiceManagers[] = { AVMEDIA_MANAGER_SERVICE_PREFERRED, AVMEDIA_MANAGER_SERVICE_NAME, }; - for (sal_uInt32 i = 0; !xPlayer.is() && i < SAL_N_ELEMENTS( aServiceManagers ); ++i) + for (const auto& rServiceName : aServiceManagers) { - const OUString aServiceName(aServiceManagers[i], - strlen( aServiceManagers[i]), - RTL_TEXTENCODING_ASCII_US); - - xPlayer = createPlayer(rURL, aServiceName, xContext); + xPlayer = createPlayer(rURL, rServiceName, xContext); + if (xPlayer) + break; } } |