summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-18 10:10:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-24 09:45:04 +0100
commitbb06f51308428500c9c8d11ae05f0aa03ecc179c (patch)
treeb18620e8572ed6d4c43c8605660d59f5f7a7e531 /desktop
parent42e8e16cf93dcf944e5c1106f76aaa32057c0397 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx2
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx8
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.hxx2
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx4
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx80
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx2
-rw-r--r--desktop/source/lib/init.cxx6
-rw-r--r--desktop/source/migration/migration.cxx6
-rw-r--r--desktop/source/migration/migration_impl.hxx6
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx2
11 files changed, 60 insertions, 60 deletions
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<Reference<css::deployment::XPackage> > 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<Reference<css::deployment::XPackage> > >
uno::Sequence<Reference<css::deployment::XPackage> > userExt =
getUserRepository()->getDeployedPackages(xAbort, xCmdEnv);
- addExtensionsToMap(mapExt, userExt, "user");
+ addExtensionsToMap(mapExt, userExt, u"user");
uno::Sequence<Reference<css::deployment::XPackage> > sharedExt =
getSharedRepository()->getDeployedPackages(xAbort, xCmdEnv);
- addExtensionsToMap(mapExt, sharedExt, "shared");
+ addExtensionsToMap(mapExt, sharedExt, u"shared");
uno::Sequence<Reference<css::deployment::XPackage> > 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<css::uno::Reference<css::deployment::XPackage> > 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<deployment::XExtensionManager> 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<css::script::XLibraryContainer3> 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<deployment::XPackage> findPackage(
OUString const & repository,
Reference<deployment::XExtensionManager> const & manager,
Reference<ucb::XCommandEnvironment > const & environment,
- OUString const & idOrFileName )
+ std::u16string_view idOrFileName )
{
const Sequence< Reference<deployment::XPackage> > ps(
manager->getDeployedExtensions(repository,