From bb06f51308428500c9c8d11ae05f0aa03ecc179c Mon Sep 17 00:00:00 2001 From: Noel Date: Wed, 18 Nov 2020 10:10:40 +0200 Subject: loplugin:stringviewparam extend to comparison operators which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../deployment/inc/dp_descriptioninfoset.hxx | 2 +- .../deployment/manager/dp_extensionmanager.cxx | 8 +-- .../deployment/manager/dp_extensionmanager.hxx | 2 +- .../deployment/manager/dp_informationprovider.cxx | 4 +- .../deployment/misc/dp_descriptioninfoset.cxx | 2 +- desktop/source/deployment/misc/dp_platform.cxx | 80 +++++++++++----------- .../deployment/registry/script/dp_script.cxx | 2 +- desktop/source/lib/init.cxx | 6 +- desktop/source/migration/migration.cxx | 6 +- desktop/source/migration/migration_impl.hxx | 6 +- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 2 +- 11 files changed, 60 insertions(+), 60 deletions(-) (limited to 'desktop') diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx index 9b857746c005..40197f7efb7c 100644 --- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx +++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx @@ -260,7 +260,7 @@ private: /** Helper method to compare the versions with the current version */ SAL_DLLPRIVATE static bool - checkDenylistVersion(const OUString& currentversion, + checkDenylistVersion(std::u16string_view currentversion, css::uno::Sequence< OUString > const & versions); css::uno::Reference< css::uno::XComponentContext > m_context; diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 2f82d3d500ad..d126ccdd8412 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -244,7 +244,7 @@ ExtensionManager::getPackageManager(OUString const & repository) void ExtensionManager::addExtensionsToMap( id2extensions & mapExt, uno::Sequence > const & seqExt, - OUString const & repository) + std::u16string_view repository) { //Determine the index in the vector where these extensions are to be //added. @@ -1095,13 +1095,13 @@ uno::Sequence< uno::Sequence > > uno::Sequence > userExt = getUserRepository()->getDeployedPackages(xAbort, xCmdEnv); - addExtensionsToMap(mapExt, userExt, "user"); + addExtensionsToMap(mapExt, userExt, u"user"); uno::Sequence > sharedExt = getSharedRepository()->getDeployedPackages(xAbort, xCmdEnv); - addExtensionsToMap(mapExt, sharedExt, "shared"); + addExtensionsToMap(mapExt, sharedExt, u"shared"); uno::Sequence > bundledExt = getBundledRepository()->getDeployedPackages(xAbort, xCmdEnv); - addExtensionsToMap(mapExt, bundledExt, "bundled"); + addExtensionsToMap(mapExt, bundledExt, u"bundled"); // Create the tmp repository to trigger its clean up (deletion // of old temporary data.) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 944653b72640..28c2f569f6ef 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -199,7 +199,7 @@ private: void addExtensionsToMap( id2extensions & mapExt, css::uno::Sequence > const & seqExt, - OUString const & repository); + std::u16string_view repository); /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index 7825ae058041..738600556dd9 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -80,7 +80,7 @@ private: uno::Reference< uno::XComponentContext> mxContext; OUString getPackageLocation( const OUString& repository, - const OUString& _sExtensionId ); + std::u16string_view _sExtensionId ); uno::Reference< deployment::XUpdateInformationProvider > mxUpdateInformation; }; @@ -112,7 +112,7 @@ css::uno::Sequence< OUString > PackageInformationProvider::getSupportedServiceNa OUString PackageInformationProvider::getPackageLocation( const OUString & repository, - const OUString& _rExtensionId ) + std::u16string_view _rExtensionId ) { OUString aLocationURL; uno::Reference xManager = diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx index 3a55a4483e18..183434efba24 100644 --- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx +++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx @@ -430,7 +430,7 @@ void DescriptionInfoset::checkDenylist() const } bool DescriptionInfoset::checkDenylistVersion( - const OUString& currentversion, + std::u16string_view currentversion, css::uno::Sequence< OUString > const & versions) { sal_Int32 nLen = versions.getLength(); diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx index fb72d7d2b3ff..229208916598 100644 --- a/desktop/source/deployment/misc/dp_platform.cxx +++ b/desktop/source/deployment/misc/dp_platform.cxx @@ -62,7 +62,7 @@ namespace } }; - bool checkOSandCPU(OUString const & os, OUString const & cpu) + bool checkOSandCPU(std::u16string_view os, std::u16string_view cpu) { return (os == StrOperatingSystem::get()) && (cpu == StrCPU::get()); @@ -74,83 +74,83 @@ namespace if (token == PLATFORM_ALL) ret = true; else if (token == "windows_x86") - ret = checkOSandCPU("Windows", "x86"); + ret = checkOSandCPU(u"Windows", u"x86"); else if (token == "windows_x86_64") - ret = checkOSandCPU("Windows", "X86_64"); + ret = checkOSandCPU(u"Windows", u"X86_64"); else if (token == "solaris_sparc") - ret = checkOSandCPU("Solaris", "SPARC"); + ret = checkOSandCPU(u"Solaris", u"SPARC"); else if (token == "solaris_sparc64") - ret = checkOSandCPU("Solaris", "SPARC64"); + ret = checkOSandCPU(u"Solaris", u"SPARC64"); else if (token == "solaris_x86") - ret = checkOSandCPU("Solaris", "x86"); + ret = checkOSandCPU(u"Solaris", u"x86"); else if (token == "aix_powerpc") - ret = checkOSandCPU("AIX", "PowerPC"); + ret = checkOSandCPU(u"AIX", u"PowerPC"); else if (token == "macosx_x86_64") - ret = checkOSandCPU("MacOSX", "X86_64"); + ret = checkOSandCPU(u"MacOSX", u"X86_64"); else if (token == "linux_x86") - ret = checkOSandCPU("Linux", "x86"); + ret = checkOSandCPU(u"Linux", u"x86"); else if (token == "linux_x86_64") - ret = checkOSandCPU("Linux", "X86_64"); + ret = checkOSandCPU(u"Linux", u"X86_64"); else if (token == "linux_sparc") - ret = checkOSandCPU("Linux", "SPARC"); + ret = checkOSandCPU(u"Linux", u"SPARC"); else if (token == "linux_sparc64") - ret = checkOSandCPU("Linux", "SPARC64"); + ret = checkOSandCPU(u"Linux", u"SPARC64"); else if (token == "linux_powerpc") - ret = checkOSandCPU("Linux", "PowerPC"); + ret = checkOSandCPU(u"Linux", u"PowerPC"); else if (token == "linux_powerpc64") - ret = checkOSandCPU("Linux", "PowerPC_64"); + ret = checkOSandCPU(u"Linux", u"PowerPC_64"); else if (token == "linux_powerpc64_le") - ret = checkOSandCPU("Linux", "PowerPC_64_LE"); + ret = checkOSandCPU(u"Linux", u"PowerPC_64_LE"); else if (token == "linux_arm_eabi") - ret = checkOSandCPU("Linux", "ARM_EABI"); + ret = checkOSandCPU(u"Linux", u"ARM_EABI"); else if (token == "linux_arm_oabi") - ret = checkOSandCPU("Linux", "ARM_OABI"); + ret = checkOSandCPU(u"Linux", u"ARM_OABI"); else if (token == "linux_mips_el") - ret = checkOSandCPU("Linux", "MIPS_EL"); + ret = checkOSandCPU(u"Linux", u"MIPS_EL"); else if (token == "linux_mips64_el") - ret = checkOSandCPU("Linux", "MIPS64_EL"); + ret = checkOSandCPU(u"Linux", u"MIPS64_EL"); else if (token == "linux_mips_eb") - ret = checkOSandCPU("Linux", "MIPS_EB"); + ret = checkOSandCPU(u"Linux", u"MIPS_EB"); else if (token == "linux_mips64_eb") - ret = checkOSandCPU("Linux", "MIPS64_EB"); + ret = checkOSandCPU(u"Linux", u"MIPS64_EB"); else if (token == "linux_ia64") - ret = checkOSandCPU("Linux", "IA64"); + ret = checkOSandCPU(u"Linux", u"IA64"); else if (token == "linux_m68k") - ret = checkOSandCPU("Linux", "M68K"); + ret = checkOSandCPU(u"Linux", u"M68K"); else if (token == "linux_s390") - ret = checkOSandCPU("Linux", "S390"); + ret = checkOSandCPU(u"Linux", u"S390"); else if (token == "linux_s390x") - ret = checkOSandCPU("Linux", "S390x"); + ret = checkOSandCPU(u"Linux", u"S390x"); else if (token == "linux_hppa") - ret = checkOSandCPU("Linux", "HPPA"); + ret = checkOSandCPU(u"Linux", u"HPPA"); else if (token == "linux_alpha") - ret = checkOSandCPU("Linux", "ALPHA"); + ret = checkOSandCPU(u"Linux", u"ALPHA"); else if (token == "linux_aarch64") - ret = checkOSandCPU("Linux", "AARCH64"); + ret = checkOSandCPU(u"Linux", u"AARCH64"); else if (token == "freebsd_x86") - ret = checkOSandCPU("FreeBSD", "x86"); + ret = checkOSandCPU(u"FreeBSD", u"x86"); else if (token == "freebsd_x86_64") - ret = checkOSandCPU("FreeBSD", "X86_64"); + ret = checkOSandCPU(u"FreeBSD", u"X86_64"); else if (token == "freebsd_powerpc") - ret = checkOSandCPU("FreeBSD", "PowerPC"); + ret = checkOSandCPU(u"FreeBSD", u"PowerPC"); else if (token == "freebsd_powerpc64") - ret = checkOSandCPU("FreeBSD", "PowerPC64"); + ret = checkOSandCPU(u"FreeBSD", u"PowerPC64"); else if (token == "kfreebsd_x86") - ret = checkOSandCPU("kFreeBSD", "x86"); + ret = checkOSandCPU(u"kFreeBSD", u"x86"); else if (token == "kfreebsd_x86_64") - ret = checkOSandCPU("kFreeBSD", "X86_64"); + ret = checkOSandCPU(u"kFreeBSD", u"X86_64"); else if (token == "netbsd_x86") - ret = checkOSandCPU("NetBSD", "x86"); + ret = checkOSandCPU(u"NetBSD", u"x86"); else if (token == "netbsd_x86_64") - ret = checkOSandCPU("NetBSD", "X86_64"); + ret = checkOSandCPU(u"NetBSD", u"X86_64"); else if (token == "openbsd_x86") - ret = checkOSandCPU("OpenBSD", "x86"); + ret = checkOSandCPU(u"OpenBSD", u"x86"); else if (token == "openbsd_x86_64") - ret = checkOSandCPU("OpenBSD", "X86_64"); + ret = checkOSandCPU(u"OpenBSD", u"X86_64"); else if (token == "dragonfly_x86") - ret = checkOSandCPU("DragonFly", "x86"); + ret = checkOSandCPU(u"DragonFly", u"x86"); else if (token == "dragonfly_x86_64") - ret = checkOSandCPU("DragonFly", "X86_64"); + ret = checkOSandCPU(u"DragonFly", u"X86_64"); else { OSL_FAIL("Extension Manager: The extension supports an unknown platform. " diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index 29b75fbfe53d..e4fd8e07fead 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -330,7 +330,7 @@ void lcl_maybeRemoveScript( bool const bExists, OUString const& rName, - OUString const& rScriptURL, + std::u16string_view rScriptURL, Reference const& xScriptLibs) { if (bExists && xScriptLibs.is() && xScriptLibs->hasByName(rName)) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cf8503bf136d..06d0a1de31d2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -880,7 +880,7 @@ void ExecuteOrientationChange() mxUndoManager->leaveUndoContext(); } -void setupSidebar(const OUString& sidebarDeckId = "") +void setupSidebar(std::u16string_view sidebarDeckId = u"") { SfxViewShell* pViewShell = SfxViewShell::Current(); SfxViewFrame* pViewFrame = pViewShell ? pViewShell->GetViewFrame() : nullptr; @@ -908,7 +908,7 @@ void setupSidebar(const OUString& sidebarDeckId = "") if (currentDeckId == "ChartDeck") switchToDefault = false; - if (!sidebarDeckId.isEmpty()) + if (!sidebarDeckId.empty()) { pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId); } @@ -3954,7 +3954,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma } else if (gImpl && aCommand == ".uno:LOKSidebarWriterPage") { - setupSidebar("WriterPageDeck"); + setupSidebar(u"WriterPageDeck"); return; } else if (gImpl && aCommand == ".uno:SidebarShow") diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index ab22b4abdfe2..4197a245cd94 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -1016,7 +1016,7 @@ void MigrationImpl::mergeOldToNewVersion(const uno::Reference< ui::XUIConfigurat xUIConfigurationPersistence->store(); } -uno::Reference< ui::XUIConfigurationManager > NewVersionUIInfo::getConfigManager(const OUString& sModuleShortName) const +uno::Reference< ui::XUIConfigurationManager > NewVersionUIInfo::getConfigManager(std::u16string_view sModuleShortName) const { uno::Reference< ui::XUIConfigurationManager > xCfgManager; @@ -1030,7 +1030,7 @@ uno::Reference< ui::XUIConfigurationManager > NewVersionUIInfo::getConfigManager return xCfgManager; } -uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewMenubarSettings(const OUString& sModuleShortName) const +uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewMenubarSettings(std::u16string_view sModuleShortName) const { uno::Reference< container::XIndexContainer > xNewMenuSettings; @@ -1044,7 +1044,7 @@ uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewMenubarSett return xNewMenuSettings; } -uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewToolbarSettings(const OUString& sModuleShortName, const OUString& sToolbarName) const +uno::Reference< container::XIndexContainer > NewVersionUIInfo::getNewToolbarSettings(std::u16string_view sModuleShortName, std::u16string_view sToolbarName) const { uno::Reference< container::XIndexContainer > xNewToolbarSettings; diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx index 0a1e7d8dc61b..3b9cb09d3856 100644 --- a/desktop/source/migration/migration_impl.hxx +++ b/desktop/source/migration/migration_impl.hxx @@ -127,9 +127,9 @@ class NewVersionUIInfo { public: - css::uno::Reference< css::ui::XUIConfigurationManager > getConfigManager(const OUString& sModuleShortName) const; - css::uno::Reference< css::container::XIndexContainer > getNewMenubarSettings(const OUString& sModuleShortName) const; - css::uno::Reference< css::container::XIndexContainer > getNewToolbarSettings(const OUString& sModuleShortName, const OUString& sToolbarName) const; + css::uno::Reference< css::ui::XUIConfigurationManager > getConfigManager(std::u16string_view sModuleShortName) const; + css::uno::Reference< css::container::XIndexContainer > getNewMenubarSettings(std::u16string_view sModuleShortName) const; + css::uno::Reference< css::container::XIndexContainer > getNewToolbarSettings(std::u16string_view sModuleShortName, std::u16string_view sToolbarName) const; void init(const std::vector< MigrationModuleInfo >& vModulesInfo); private: diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 6c9f8ce00bae..53b2a23aec91 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -162,7 +162,7 @@ Reference findPackage( OUString const & repository, Reference const & manager, Reference const & environment, - OUString const & idOrFileName ) + std::u16string_view idOrFileName ) { const Sequence< Reference > ps( manager->getDeployedExtensions(repository, -- cgit