loplugin:ostr in shell

Change-Id: Ia3b9f7dc0ae67f420c3bed370f549a492251156b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167705
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2024-05-16 08:49:30 +02:00
parent 55eb6fc8b8
commit aeb099ec66
7 changed files with 36 additions and 35 deletions
@@ -62,14 +62,14 @@ private:
virtual ~Default() override {}
virtual OUString SAL_CALL getImplementationName() override
{ return "com.sun.star.comp.configuration.backend.DesktopBackend"; }
{ return u"com.sun.star.comp.configuration.backend.DesktopBackend"_ustr; }
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
{ return ServiceName == getSupportedServiceNames()[0]; }
virtual css::uno::Sequence< OUString > SAL_CALL
getSupportedServiceNames() override
{ return { "com.sun.star.configuration.backend.DesktopBackend" }; }
{ return { u"com.sun.star.configuration.backend.DesktopBackend"_ustr }; }
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() override
@@ -105,7 +105,7 @@ private:
void Default::setPropertyValue(OUString const &, css::uno::Any const &)
{
throw css::lang::IllegalArgumentException(
"setPropertyValue not supported",
u"setPropertyValue not supported"_ustr,
getXWeak(), -1);
}
@@ -125,7 +125,7 @@ OUString xdg_user_dir_lookup (const char *type, bool bAllowHomeDir)
if (!aSecurity.getHomeDir( aHomeDirURL ) )
{
osl::FileBase::getFileURLFromSystemPath("/tmp", aDocumentsDirURL);
osl::FileBase::getFileURLFromSystemPath(u"/tmp"_ustr, aDocumentsDirURL);
return aDocumentsDirURL;
}
@@ -279,14 +279,14 @@ shell_DesktopBackend_get_implementation(
css::uno::Reference< css::uno::XCurrentContext > current(
css::uno::getCurrentContext());
if (current.is()) {
current->getValueByName("system.desktop-environment") >>= desktop;
current->getValueByName(u"system.desktop-environment"_ustr) >>= desktop;
}
// Fall back to the default if the specific backend is not available:
css::uno::Reference< css::uno::XInterface > backend;
if (desktop == "PLASMA5")
backend = createBackend(context,
"com.sun.star.configuration.backend.KF5Backend");
u"com.sun.star.configuration.backend.KF5Backend"_ustr);
if (!backend)
backend = getXWeak(new Default);
backend->acquire();
+9 -8
View File
@@ -64,7 +64,7 @@ private:
virtual OUString SAL_CALL getImplementationName() override
{
return "com.sun.star.comp.configuration.backend.KF5Backend";
return u"com.sun.star.comp.configuration.backend.KF5Backend"_ustr;
}
virtual sal_Bool SAL_CALL supportsService(OUString const& ServiceName) override
@@ -74,7 +74,7 @@ private:
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
{
return { "com.sun.star.configuration.backend.KF5Backend" };
return { u"com.sun.star.configuration.backend.KF5Backend"_ustr };
}
virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override
@@ -137,10 +137,10 @@ OString getExecutable()
void readKDESettings(std::map<OUString, css::beans::Optional<css::uno::Any>>& rSettings)
{
const std::vector<OUString> aKeys
= { "EnableATToolSupport", "ExternalMailer", "SourceViewFontHeight",
"SourceViewFontName", "WorkPathVariable", "ooInetHTTPProxyName",
"ooInetHTTPProxyPort", "ooInetHTTPSProxyName", "ooInetHTTPSProxyPort",
"ooInetNoProxy", "ooInetProxyType" };
= { u"EnableATToolSupport"_ustr, u"ExternalMailer"_ustr, u"SourceViewFontHeight"_ustr,
u"SourceViewFontName"_ustr, u"WorkPathVariable"_ustr, u"ooInetHTTPProxyName"_ustr,
u"ooInetHTTPProxyPort"_ustr, u"ooInetHTTPSProxyName"_ustr, u"ooInetHTTPSProxyPort"_ustr,
u"ooInetNoProxy"_ustr, u"ooInetProxyType"_ustr };
for (const OUString& aKey : aKeys)
{
@@ -202,7 +202,7 @@ Service::Service()
return;
OUString desktop;
context->getValueByName("system.desktop-environment") >>= desktop;
context->getValueByName(u"system.desktop-environment"_ustr) >>= desktop;
if (desktop == "PLASMA5")
{
@@ -219,7 +219,8 @@ Service::Service()
void Service::setPropertyValue(OUString const&, css::uno::Any const&)
{
throw css::lang::IllegalArgumentException("setPropertyValue not supported", getXWeak(), -1);
throw css::lang::IllegalArgumentException(u"setPropertyValue not supported"_ustr, getXWeak(),
-1);
}
css::uno::Any Service::getPropertyValue(OUString const& PropertyName)
@@ -173,7 +173,7 @@ static css::beans::Optional<css::uno::Any> ImplGetLocale(char const * category)
// Return "en-US" for C locales
if( (locale == nullptr) || *locale == '\0' || std::strcmp(locale, "C") == 0
|| std::strcmp(locale, "POSIX") == 0 )
return {true, css::uno::Any(OUString("en-US"))};
return {true, css::uno::Any(u"en-US"_ustr)};
const char *cp;
@@ -285,7 +285,7 @@ void LocaleBackend::setPropertyValue(
OUString const &, css::uno::Any const &)
{
throw css::lang::IllegalArgumentException(
"setPropertyValue not supported",
u"setPropertyValue not supported"_ustr,
getXWeak(), -1);
}
@@ -309,7 +309,7 @@ css::uno::Any LocaleBackend::getPropertyValue(
OUString SAL_CALL LocaleBackend::getImplementationName()
{
return "com.sun.star.comp.configuration.backend.LocaleBackend" ;
return u"com.sun.star.comp.configuration.backend.LocaleBackend"_ustr ;
}
sal_Bool SAL_CALL LocaleBackend::supportsService(const OUString& aServiceName)
@@ -319,7 +319,7 @@ sal_Bool SAL_CALL LocaleBackend::supportsService(const OUString& aServiceName)
uno::Sequence<OUString> SAL_CALL LocaleBackend::getSupportedServiceNames()
{
return { "com.sun.star.configuration.backend.LocaleBackend" };
return { u"com.sun.star.configuration.backend.LocaleBackend"_ustr };
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+10 -10
View File
@@ -113,24 +113,24 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
{
if ( ! xSimpleMailMessage.is() )
{
throw css::lang::IllegalArgumentException( "No message specified" ,
throw css::lang::IllegalArgumentException( u"No message specified"_ustr ,
static_cast < XSimpleMailClient * > (this), 1 );
}
if( ! m_xConfigurationProvider.is() )
{
throw css::uno::Exception( "Can not access configuration" ,
throw css::uno::Exception( u"Can not access configuration"_ustr ,
static_cast < XSimpleMailClient * > (this) );
}
OUString aProgramURL("$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/senddoc");
OUString aProgramURL(u"$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/senddoc"_ustr);
rtl::Bootstrap::expandMacros(aProgramURL);
OUString aProgram;
if ( FileBase::E_None != FileBase::getSystemPathFromFileURL(aProgramURL, aProgram))
{
throw css::uno::Exception("Could not convert executable path",
throw css::uno::Exception(u"Could not convert executable path"_ustr,
static_cast < XSimpleMailClient * > (this));
}
@@ -145,13 +145,13 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
PropertyValue aProperty;
aProperty.Name = "nodepath";
aProperty.Value <<= OUString("org.openoffice.Office.Common/ExternalMailer");
aProperty.Value <<= u"org.openoffice.Office.Common/ExternalMailer"_ustr;
Sequence< Any > aArgumentList{ Any(aProperty) };
Reference< XNameAccess > xNameAccess(
m_xConfigurationProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess",
u"com.sun.star.configuration.ConfigurationAccess"_ustr,
aArgumentList ),
UNO_QUERY );
@@ -161,7 +161,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
// Retrieve the value for "Program" node and append it feed senddoc with it
// using the (undocumented) --mailclient switch
xNameAccess->getByName("Program") >>= aMailer;
xNameAccess->getByName(u"Program"_ustr) >>= aMailer;
if( !aMailer.isEmpty() )
{
@@ -255,7 +255,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
FILE * f = popen(cmd.getStr(), "w");
if (f == nullptr || pclose(f) != 0)
{
throw css::uno::Exception("No mail client configured",
throw css::uno::Exception(u"No mail client configured"_ustr,
static_cast < XSimpleMailClient * > (this) );
}
}
@@ -264,7 +264,7 @@ void SAL_CALL CmdMailSuppl::sendSimpleMailMessage( const Reference< XSimpleMailM
OUString SAL_CALL CmdMailSuppl::getImplementationName( )
{
return "com.sun.star.comp.system.SimpleCommandMail";
return u"com.sun.star.comp.system.SimpleCommandMail"_ustr;
}
sal_Bool SAL_CALL CmdMailSuppl::supportsService( const OUString& ServiceName )
@@ -274,7 +274,7 @@ sal_Bool SAL_CALL CmdMailSuppl::supportsService( const OUString& ServiceName )
Sequence< OUString > SAL_CALL CmdMailSuppl::getSupportedServiceNames( )
{
return { "com.sun.star.system.SimpleCommandMail" };
return { u"com.sun.star.system.SimpleCommandMail"_ustr };
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
@@ -55,7 +55,7 @@ namespace
&error.getRef());
}
if(!proxy)
throw RuntimeException("couldn't get a proxy!");
throw RuntimeException(u"couldn't get a proxy!"_ustr);
return proxy;
}
@@ -105,12 +105,12 @@ namespace shell::sessioninstall
Sequence< OUString > SAL_CALL SyncDbusSessionHelper::getSupportedServiceNames()
{
return { "org.freedesktop.PackageKit.SyncDbusSessionHelper" };
return { u"org.freedesktop.PackageKit.SyncDbusSessionHelper"_ustr };
}
OUString SAL_CALL SyncDbusSessionHelper::getImplementationName()
{
return "org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper";
return u"org.libreoffice.comp.shell.sessioninstall.SyncDbusSessionHelper"_ustr;
}
sal_Bool SAL_CALL SyncDbusSessionHelper::supportsService(const OUString& aServiceName)
@@ -43,7 +43,7 @@ namespace shell::sessioninstall
virtual void SAL_CALL InstallGStreamerResources( const css::uno::Sequence< OUString >& resources, const OUString& interaction ) override;
virtual void SAL_CALL InstallResources( const css::uno::Sequence< OUString >& /* types */, const css::uno::Sequence< OUString >& /* resources */, const OUString& /* interaction */ ) override
{ throw css::uno::RuntimeException("InstallResources is not implemented"); } // not implemented
{ throw css::uno::RuntimeException(u"InstallResources is not implemented"_ustr); } // not implemented
virtual void SAL_CALL RemovePackageByFiles( const css::uno::Sequence< OUString >& files, const OUString& interaction ) override;
@@ -53,7 +53,7 @@ namespace shell::sessioninstall
virtual void SAL_CALL IsInstalled( const OUString& /* package_name */, const OUString& /* interaction */, sal_Bool& /* installed */ ) override;
virtual void SAL_CALL SearchFile( const OUString& /* file_name */, const OUString& /* interaction */, sal_Bool& /* installed */, OUString& /* package_name */ ) override
{ throw css::uno::RuntimeException("SearchFile is not implemented"); } // not implemented
{ throw css::uno::RuntimeException(u"SearchFile is not implemented"_ustr); } // not implemented
private:
SyncDbusSessionHelper( const SyncDbusSessionHelper& ) = delete;
+2 -2
View File
@@ -287,7 +287,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
OUString SAL_CALL ShellExec::getImplementationName( )
{
return "com.sun.star.comp.system.SystemShellExecute";
return u"com.sun.star.comp.system.SystemShellExecute"_ustr;
}
sal_Bool SAL_CALL ShellExec::supportsService( const OUString& ServiceName )
@@ -297,7 +297,7 @@ sal_Bool SAL_CALL ShellExec::supportsService( const OUString& ServiceName )
Sequence< OUString > SAL_CALL ShellExec::getSupportedServiceNames( )
{
return { "com.sun.star.system.SystemShellExecute" };
return { u"com.sun.star.system.SystemShellExecute"_ustr };
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*