summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-11-19 23:24:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-11-20 07:26:01 +0100
commitb5da85150d0b4ab693616b0f6af613842b7acde3 (patch)
tree6533e1608be8a2386009f1163d36bc1d527f39b2 /desktop/source
parenta5f5eb28d0dcb66d5d947db7087f501ec73e00d7 (diff)
Extended loplugin:ostr: desktop
Change-Id: I0c86c1207f906e19c770b71ae1c5daec1c912845 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159717 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/dispatchwatcher.cxx2
-rw-r--r--desktop/source/app/lockfile2.cxx8
-rw-r--r--desktop/source/app/officeipcthread.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx2
-rw-r--r--desktop/source/deployment/misc/lockfile.cxx24
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx8
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx4
8 files changed, 26 insertions, 26 deletions
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index b00cff042b7e..863d246951e9 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -267,7 +267,7 @@ void batchPrint( std::u16string_view rPrinterName, const Reference< XPrintable >
OString aTargetURL8 = OUStringToOString(aTempName, osl_getThreadTextEncoding() );
std::cout << "print " << aSource8 << " -> " << aTargetURL8;
- std::cout << " using " << (aPrinterName.isEmpty() ? "<default_printer>" : OUStringToOString( aPrinterName, osl_getThreadTextEncoding() ));
+ std::cout << " using " << (aPrinterName.isEmpty() ? "<default_printer>"_ostr : OUStringToOString( aPrinterName, osl_getThreadTextEncoding() ));
std::cout << std::endl;
// create the custom printer, if given
diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx
index 44447927f63b..98c2903f9403 100644
--- a/desktop/source/app/lockfile2.cxx
+++ b/desktop/source/app/lockfile2.cxx
@@ -31,10 +31,10 @@ bool Lockfile_execWarning( Lockfile const * that )
// read information from lock
OUString aLockname = that->m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup( LOCKFILE_GROUP );
- OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
- OString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
- OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY );
+ aConfig.SetGroup( LOCKFILE_GROUP ""_ostr );
+ OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY ""_ostr );
+ OString aUser = aConfig.ReadKey( LOCKFILE_USERKEY ""_ostr );
+ OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY ""_ostr );
// display warning and return response
std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr,
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 9b77da1a9037..9d342bf35a84 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -76,7 +76,7 @@ OString readStringFromPipe(osl::StreamPipe const & pipe) {
sal_Int32 n = pipe.recv(buf, std::size(buf));
if (n <= 0) {
SAL_INFO("desktop.app", "read empty string");
- return "";
+ return ""_ostr;
}
bool end = false;
if (buf[n - 1] == '\0') {
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index b51f4c77b47b..f393a30c9489 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -104,7 +104,7 @@ void writeLastModified(OUString & url, Reference<ucb::XCommandEnvironment> const
::rtl::Bootstrap::expandMacros(url);
::ucbhelper::Content ucbStamp(url, xCmdEnv, xContext);
dp_misc::erase_path( url, xCmdEnv );
- OString stamp("1" );
+ OString stamp("1"_ostr );
Reference<css::io::XInputStream> xData(
::xmlscript::createInputStream(
reinterpret_cast<sal_Int8 const *>(stamp.getStr()),
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 206b44d85bd6..d882b77bafa3 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -981,7 +981,7 @@ Reference<deployment::XPackage> PackageManagerImpl::getDeployedPackage_(
INetContentTypeParameterList params;
if (INetContentTypes::parse( data.mediaType, type, subType, &params ))
{
- auto const iter = params.find(OString("platform"));
+ auto const iter = params.find("platform"_ostr);
if (iter != params.end() && !platform_fits(iter->second.m_sValue))
throw lang::IllegalArgumentException(
DpResId(RID_STR_NO_SUCH_PACKAGE) + id,
diff --git a/desktop/source/deployment/misc/lockfile.cxx b/desktop/source/deployment/misc/lockfile.cxx
index a46eedc62a3a..1a87e8bc0f6f 100644
--- a/desktop/source/deployment/misc/lockfile.cxx
+++ b/desktop/source/deployment/misc/lockfile.cxx
@@ -67,7 +67,7 @@ static OString impl_getHostname()
aHost = OString( pHostName );
}
else
- aHost = OString("UNKNOWN");
+ aHost = "UNKNOWN"_ostr;
#endif
return aHost;
@@ -153,13 +153,13 @@ namespace desktop {
// to assume that it is a stale lockfile which can be overwritten
OUString aLockname = m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup(LOCKFILE_GROUP);
- OString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY );
+ aConfig.SetGroup(LOCKFILE_GROUP ""_ostr);
+ OString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY ""_ostr );
if (!aIPCserver.equalsIgnoreAsciiCase("true"))
return false;
- OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
- OString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
+ OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY ""_ostr );
+ OString aUser = aConfig.ReadKey( LOCKFILE_USERKEY ""_ostr );
// lockfile from same host?
OString myHost( impl_getHostname() );
@@ -179,7 +179,7 @@ namespace desktop {
{
OUString aLockname = m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup(LOCKFILE_GROUP);
+ aConfig.SetGroup(LOCKFILE_GROUP ""_ostr);
// get information
OString aHost( impl_getHostname() );
@@ -191,13 +191,13 @@ namespace desktop {
OString aStamp = OUStringToOString( m_aId, RTL_TEXTENCODING_ASCII_US );
// write information
- aConfig.WriteKey( LOCKFILE_USERKEY, aUser );
- aConfig.WriteKey( LOCKFILE_HOSTKEY, aHost );
- aConfig.WriteKey( LOCKFILE_STAMPKEY, aStamp );
- aConfig.WriteKey( LOCKFILE_TIMEKEY, aTime );
+ aConfig.WriteKey( LOCKFILE_USERKEY ""_ostr, aUser );
+ aConfig.WriteKey( LOCKFILE_HOSTKEY ""_ostr, aHost );
+ aConfig.WriteKey( LOCKFILE_STAMPKEY ""_ostr, aStamp );
+ aConfig.WriteKey( LOCKFILE_TIMEKEY ""_ostr, aTime );
aConfig.WriteKey(
- LOCKFILE_IPCKEY,
- m_bIPCserver ? OString("true") : OString("false") );
+ LOCKFILE_IPCKEY ""_ostr,
+ m_bIPCserver ? "true"_ostr : "false"_ostr );
aConfig.Flush( );
}
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 849a4784168b..7a692ec8c6c5 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -654,7 +654,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
// xxx todo: probe and evaluate component xml description
- auto const iter = params.find(OString("platform"));
+ auto const iter = params.find("platform"_ostr);
bool bPlatformFits(iter == params.end());
OUString aPlatform;
if (!bPlatformFits) // platform is specified, we have to check
@@ -665,7 +665,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
// If the package is being removed, do not care whether
// platform fits. We won't be using it anyway.
if (bPlatformFits || bRemoved) {
- auto const iterType = params.find(OString("type"));
+ auto const iterType = params.find("type"_ostr);
if (iterType != params.end())
{
OUString const & value = iterType->second.m_sValue;
@@ -697,7 +697,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
}
else if (subType.equalsIgnoreAsciiCase("vnd.sun.star.uno-components"))
{
- auto const iter = params.find(OString("platform"));
+ auto const iter = params.find("platform"_ostr);
if (iter == params.end() || platform_fits(iter->second.m_sValue)) {
return new BackendImpl::ComponentsPackageImpl(
this, url, name, m_xComponentsTypeInfo, bRemoved,
@@ -706,7 +706,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
}
else if (subType.equalsIgnoreAsciiCase( "vnd.sun.star.uno-typelibrary"))
{
- auto const iter = params.find(OString("type"));
+ auto const iter = params.find("type"_ostr);
if (iter != params.end()) {
OUString const & value = iter->second.m_sValue;
if (value.equalsIgnoreAsciiCase("RDB"))
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 3a6c466a1813..6af2fb5515f5 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1383,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;
}
@@ -1394,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())