diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 13:22:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-19 15:23:35 +0100 |
commit | 56c89190a2c717d6c24f2826f3b82ffe41b0ab6e (patch) | |
tree | 33929e7c7177de0bea5a6512bb2b70dfecab5847 /vcl/unx | |
parent | e4d8f186d07aa1999e16abff3381e37b8764e964 (diff) |
Extended loplugin:ostr: vcl
Change-Id: I2a9d5383d1831d8bf61e5280d66556d71fccae52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/app/sm.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/helper.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/cpdmgr.cxx | 26 | ||||
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 34 | ||||
-rw-r--r-- | vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 2 |
5 files changed, 36 insertions, 36 deletions
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 3ad2c855a5c4..071ac32fdbe1 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -159,9 +159,9 @@ SalSession * SessionManagerClient::m_pSession = nullptr; std::unique_ptr< ICEConnectionObserver > SessionManagerClient::m_xICEConnectionObserver; SmcConn SessionManagerClient::m_pSmcConnection = nullptr; -OString SessionManagerClient::m_aClientID = ""; -OString SessionManagerClient::m_aTimeID = ""; -OString SessionManagerClient::m_aClientTimeID = ""; +OString SessionManagerClient::m_aClientID = ""_ostr; +OString SessionManagerClient::m_aTimeID = ""_ostr; +OString SessionManagerClient::m_aClientTimeID = ""_ostr; bool SessionManagerClient::m_bDocSaveDone = false; // HACK extern "C" { @@ -228,7 +228,7 @@ static void BuildSmPropertyList() OString aRestartOption = "--session=" + SessionManagerClient::getSessionID(); pSmProps[ eRestartCommand ].vals[1].length = aRestartOption.getLength()+1; pSmProps[ eRestartCommand ].vals[1].value = strdup(aRestartOption.getStr()); - OString aRestartOptionNoLogo("--nologo"); + OString aRestartOptionNoLogo("--nologo"_ostr); pSmProps[ eRestartCommand ].vals[2].length = aRestartOptionNoLogo.getLength()+1; pSmProps[ eRestartCommand ].vals[2].value = strdup(aRestartOptionNoLogo.getStr()); diff --git a/vcl/unx/generic/fontmanager/helper.cxx b/vcl/unx/generic/fontmanager/helper.cxx index 0abbb812a610..afa6d9cb76ed 100644 --- a/vcl/unx/generic/fontmanager/helper.cxx +++ b/vcl/unx/generic/fontmanager/helper.cxx @@ -229,7 +229,7 @@ void psp::normPath( OString& rPath ) // double slashes and slash at end are probably // removed by realpath anyway, but since this runs // on many different platforms let's play it safe - OString aPath = rPath.replaceAll("//", "/"); + OString aPath = rPath.replaceAll("//"_ostr, "/"_ostr); if( aPath.endsWith("/") ) aPath = aPath.copy(0, aPath.getLength()-1); diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx index 3955a0235a0a..834c1383efba 100644 --- a/vcl/unx/generic/printer/cpdmgr.cxx +++ b/vcl/unx/generic/printer/cpdmgr.cxx @@ -624,20 +624,20 @@ void CPDManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner, if (!sPayLoad.isEmpty()) { OString aKey = OUStringToOString( pKey->getKey(), RTL_TEXTENCODING_ASCII_US ); OString aValue = OUStringToOString( sPayLoad, RTL_TEXTENCODING_ASCII_US ); - if (aKey.equals("Duplex")) { - aKey = OString("sides"); - } else if (aKey.equals("Resolution")) { - aKey = OString("printer-resolution"); - } else if (aKey.equals("PageSize")) { - aKey = OString("media"); + if (aKey.equals("Duplex"_ostr)) { + aKey = "sides"_ostr; + } else if (aKey.equals("Resolution"_ostr)) { + aKey = "printer-resolution"_ostr; + } else if (aKey.equals("PageSize"_ostr)) { + aKey = "media"_ostr; } - if (aKey.equals("sides")) { - if (aValue.equals("None")) { - aValue = OString("one-sided"); - } else if (aValue.equals("DuplexNoTumble")) { - aValue = OString("two-sided-long-edge"); - } else if (aValue.equals("DuplexTumble")) { - aValue = OString("two-sided-short-edge"); + if (aKey.equals("sides"_ostr)) { + if (aValue.equals("None"_ostr)) { + aValue = "one-sided"_ostr; + } else if (aValue.equals("DuplexNoTumble"_ostr)) { + aValue = "two-sided-long-edge"_ostr; + } else if (aValue.equals("DuplexTumble"_ostr)) { + aValue = "two-sided-short-edge"_ostr; } } g_variant_builder_add(builder, "(ss)", aKey.getStr(), aValue.getStr()); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 41f8ff9840d9..870390e39e08 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -211,15 +211,15 @@ void PrinterInfoManager::initialize() #endif aConfig.SetGroup( GLOBAL_DEFAULTS_GROUP ); - OString aValue( aConfig.ReadKey( "Copies" ) ); + OString aValue( aConfig.ReadKey( "Copies"_ostr ) ); if (!aValue.isEmpty()) m_aGlobalDefaults.m_nCopies = aValue.toInt32(); - aValue = aConfig.ReadKey( "Orientation" ); + aValue = aConfig.ReadKey( "Orientation"_ostr ); if (!aValue.isEmpty()) m_aGlobalDefaults.m_eOrientation = aValue.equalsIgnoreAsciiCase("Landscape") ? orientation::Landscape : orientation::Portrait; - aValue = aConfig.ReadKey( "MarginAdjust" ); + aValue = aConfig.ReadKey( "MarginAdjust"_ostr ); if (!aValue.isEmpty()) { sal_Int32 nIdx {0}; @@ -229,11 +229,11 @@ void PrinterInfoManager::initialize() m_aGlobalDefaults.m_nBottomMarginAdjust = o3tl::toInt32(o3tl::getToken(aValue, 0, ',', nIdx)); } - aValue = aConfig.ReadKey( "ColorDepth", "24" ); + aValue = aConfig.ReadKey( "ColorDepth"_ostr, "24"_ostr ); if (!aValue.isEmpty()) m_aGlobalDefaults.m_nColorDepth = aValue.toInt32(); - aValue = aConfig.ReadKey( "ColorDevice" ); + aValue = aConfig.ReadKey( "ColorDevice"_ostr ); if (!aValue.isEmpty()) m_aGlobalDefaults.m_nColorDevice = aValue.toInt32(); @@ -296,7 +296,7 @@ void PrinterInfoManager::initialize() for( int nGroup = 0; nGroup < aConfig.GetGroupCount(); nGroup++ ) { aConfig.SetGroup( aConfig.GetGroupName( nGroup ) ); - OString aValue = aConfig.ReadKey( "Printer" ); + OString aValue = aConfig.ReadKey( "Printer"_ostr ); if (!aValue.isEmpty()) { OUString aPrinterName; @@ -353,7 +353,7 @@ void PrinterInfoManager::initialize() } } - aValue = aConfig.ReadKey( "Command" ); + aValue = aConfig.ReadKey( "Command"_ostr ); // no printer without a command if (aValue.isEmpty()) { @@ -370,32 +370,32 @@ void PrinterInfoManager::initialize() aPrinter.m_aInfo.m_aCommand = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); } - aValue = aConfig.ReadKey( "QuickCommand" ); + aValue = aConfig.ReadKey( "QuickCommand"_ostr ); aPrinter.m_aInfo.m_aQuickCommand = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); - aValue = aConfig.ReadKey( "Features" ); + aValue = aConfig.ReadKey( "Features"_ostr ); aPrinter.m_aInfo.m_aFeatures = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); // override the settings in m_aGlobalDefaults if keys exist - aValue = aConfig.ReadKey( "DefaultPrinter" ); + aValue = aConfig.ReadKey( "DefaultPrinter"_ostr ); if (aValue != "0" && !aValue.equalsIgnoreAsciiCase("false")) aDefaultPrinter = aPrinterName; - aValue = aConfig.ReadKey( "Location" ); + aValue = aConfig.ReadKey( "Location"_ostr ); aPrinter.m_aInfo.m_aLocation = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); - aValue = aConfig.ReadKey( "Comment" ); + aValue = aConfig.ReadKey( "Comment"_ostr ); aPrinter.m_aInfo.m_aComment = OStringToOUString(aValue, RTL_TEXTENCODING_UTF8); - aValue = aConfig.ReadKey( "Copies" ); + aValue = aConfig.ReadKey( "Copies"_ostr ); if (!aValue.isEmpty()) aPrinter.m_aInfo.m_nCopies = aValue.toInt32(); - aValue = aConfig.ReadKey( "Orientation" ); + aValue = aConfig.ReadKey( "Orientation"_ostr ); if (!aValue.isEmpty()) aPrinter.m_aInfo.m_eOrientation = aValue.equalsIgnoreAsciiCase("Landscape") ? orientation::Landscape : orientation::Portrait; - aValue = aConfig.ReadKey( "MarginAdjust" ); + aValue = aConfig.ReadKey( "MarginAdjust"_ostr ); if (!aValue.isEmpty()) { sal_Int32 nIdx {0}; @@ -405,11 +405,11 @@ void PrinterInfoManager::initialize() aPrinter.m_aInfo.m_nBottomMarginAdjust = o3tl::toInt32(o3tl::getToken(aValue, 0, ',', nIdx)); } - aValue = aConfig.ReadKey( "ColorDepth" ); + aValue = aConfig.ReadKey( "ColorDepth"_ostr ); if (!aValue.isEmpty()) aPrinter.m_aInfo.m_nColorDepth = aValue.toInt32(); - aValue = aConfig.ReadKey( "ColorDevice" ); + aValue = aConfig.ReadKey( "ColorDevice"_ostr ); if (!aValue.isEmpty()) aPrinter.m_aInfo.m_nColorDevice = aValue.toInt32(); diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx index 36278074c446..aeaeccf51831 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx @@ -985,7 +985,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() RTL_TEXTENCODING_UTF8 ) ); - OString toReplace("$filename$"); + OString toReplace("$filename$"_ostr); aMsg = aMsg.replaceAt( aMsg.indexOf( toReplace ), |