diff options
Diffstat (limited to 'desktop/source/deployment/registry/package/dp_package.cxx')
-rw-r--r-- | desktop/source/deployment/registry/package/dp_package.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 321db824f40c..6af2fb5515f5 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -32,6 +32,7 @@ #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> @@ -67,11 +68,12 @@ #include <com/sun/star/deployment/PlatformException.hpp> #include <com/sun/star/deployment/Prerequisites.hpp> #include <optional> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <algorithm> #include <memory> #include <string_view> +#include <utility> #include <vector> #include "dp_extbackenddb.hxx" @@ -252,7 +254,7 @@ class XPackage_eq { OUString m_URL; public: - explicit XPackage_eq(const OUString & s) : m_URL(s) {} + explicit XPackage_eq(OUString s) : m_URL(std::move(s)) {} bool operator() (const Reference<deployment::XPackage> & p) const { return m_URL == p->getURL(); @@ -307,7 +309,7 @@ sal_Bool BackendImpl::supportsService(OUString const & ServiceName) Sequence<OUString> BackendImpl::getSupportedServiceNames() { - return { OUString(BACKEND_SERVICE_NAME) }; + return { BACKEND_SERVICE_NAME }; } // XPackageRegistry @@ -1055,9 +1057,9 @@ void BackendImpl::PackageImpl::exportTo( manifest.reserve( bundle.getLength() ); sal_Int32 baseURLlen = m_url_expanded.getLength(); Reference<deployment::XPackage> const *pbundle = bundle.getConstArray(); - static const OUStringLiteral strMediaType( u"MediaType" ); - static const OUStringLiteral strFullPath( u"FullPath" ); - static const OUStringLiteral strIsFolder( u"IsFolder" ); + static constexpr OUStringLiteral strMediaType( u"MediaType" ); + static constexpr OUStringLiteral strFullPath( u"FullPath" ); + static constexpr OUStringLiteral strIsFolder( u"IsFolder" ); for ( sal_Int32 pos = bundle.getLength(); pos--; ) { Reference<deployment::XPackage> const & xPackage = pbundle[ pos ]; @@ -1265,12 +1267,12 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( return *pBundle; } -bool isBundle_( OUString const & mediaType ) +bool isBundle_( std::u16string_view mediaType ) { // xxx todo: additional parsing? - return !mediaType.isEmpty() && - (mediaType.matchIgnoreAsciiCase( "application/vnd.sun.star.package-bundle") || - mediaType.matchIgnoreAsciiCase( "application/vnd.sun.star.legacy-package-bundle")); + return !mediaType.empty() && + (o3tl::matchIgnoreAsciiCase( mediaType, u"application/vnd.sun.star.package-bundle") || + o3tl::matchIgnoreAsciiCase( mediaType, u"application/vnd.sun.star.legacy-package-bundle")); } @@ -1381,7 +1383,7 @@ void BackendImpl::PackageImpl::scanBundle( continue; { - auto const iter = params.find("platform"); + auto const iter = params.find("platform"_ostr); if (iter != params.end() && !platform_fits(iter->second.m_sValue)) continue; } @@ -1392,7 +1394,7 @@ void BackendImpl::PackageImpl::scanBundle( subType.equalsIgnoreAsciiCase( "vnd.sun.star.package-bundle-description")) { // check locale: - auto const iter = params.find("locale"); + auto const iter = params.find("locale"_ostr); if (iter == params.end()) { if (descrFile.isEmpty()) @@ -1487,7 +1489,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle( // check for platform paths: const OUString title( StrTitle::getTitle( ucbContent ) ); if (title.endsWithIgnoreAsciiCase( ".plt" ) && - !platform_fits( title.copy( 0, title.getLength() - 4 ) )) { + !platform_fits( title.subView( 0, title.getLength() - 4 ) )) { return; } if (title.endsWithIgnoreAsciiCase("skip_registration") ) |