avmedia/source/win/framegrabber.cxx                    |    2 
 avmedia/source/win/player.cxx                          |    2 
 avmedia/source/win/window.cxx                          |    2 
 basctl/source/basicide/baside3.cxx                     |    2 
 embedserv/source/embed/intercept.cxx                   |   12 ++---
 extensions/source/config/WinUserInfo/WinUserInfoBe.cxx |   28 +++++------
 fpicker/source/win32/VistaFilePickerEventHandler.cxx   |    4 -
 fpicker/source/win32/VistaFilePickerImpl.hxx           |   40 ++++++++---------
 lingucomponent/source/lingutil/lingutil.cxx            |    2 
 sal/osl/w32/path_helper.cxx                            |    6 +-
 sal/osl/w32/procimpl.cxx                               |    3 -
 sal/qa/rtl/process/rtl_Process.cxx                     |    4 -
 vcl/win/dtrans/MimeAttrib.hxx                          |   10 ++--
 vcl/win/dtrans/ftransl.cxx                             |    2 
 14 files changed, 59 insertions(+), 60 deletions(-)

New commits:
commit c0e516609b9836f05543591398aeb7e99fe23234
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Nov 8 14:22:28 2023 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Nov 8 18:58:40 2023 +0100

    loplugin:stringstatic, lopluign:ostr (clang-cl)
    
    Change-Id: I7a928a2385286f6d1ab3887c8d315af3f47c052d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159135
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/avmedia/source/win/framegrabber.cxx 
b/avmedia/source/win/framegrabber.cxx
index 547b3ffa6a59..84e9d1b187e8 100644
--- a/avmedia/source/win/framegrabber.cxx
+++ b/avmedia/source/win/framegrabber.cxx
@@ -41,7 +41,7 @@
 #include <systools/win32/oleauto.hxx>
 
 constexpr OUStringLiteral AVMEDIA_WIN_FRAMEGRABBER_IMPLEMENTATIONNAME = 
u"com.sun.star.comp.avmedia.FrameGrabber_DirectX";
-constexpr OUStringLiteral AVMEDIA_WIN_FRAMEGRABBER_SERVICENAME = 
u"com.sun.star.media.FrameGrabber_DirectX";
+constexpr OUString AVMEDIA_WIN_FRAMEGRABBER_SERVICENAME = 
u"com.sun.star.media.FrameGrabber_DirectX"_ustr;
 
 using namespace ::com::sun::star;
 
diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx
index 5c05dcbc32dc..b52ac8171dfc 100644
--- a/avmedia/source/win/player.cxx
+++ b/avmedia/source/win/player.cxx
@@ -32,7 +32,7 @@
 #include <rtl/ref.hxx>
 
 constexpr OUStringLiteral AVMEDIA_WIN_PLAYER_IMPLEMENTATIONNAME = 
u"com.sun.star.comp.avmedia.Player_DirectX";
-constexpr OUStringLiteral AVMEDIA_WIN_PLAYER_SERVICENAME = 
u"com.sun.star.media.Player_DirectX";
+constexpr OUString AVMEDIA_WIN_PLAYER_SERVICENAME = 
u"com.sun.star.media.Player_DirectX"_ustr;
 
 using namespace ::com::sun::star;
 
diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx
index 2f453347f7cd..8cf3fee74d3d 100644
--- a/avmedia/source/win/window.cxx
+++ b/avmedia/source/win/window.cxx
@@ -29,7 +29,7 @@
 #include "player.hxx"
 
 constexpr OUStringLiteral AVMEDIA_WIN_WINDOW_IMPLEMENTATIONNAME = 
u"com.sun.star.comp.avmedia.Window_DirectX";
-constexpr OUStringLiteral AVMEDIA_WIN_WINDOW_SERVICENAME = 
u"com.sun.star.media.Window_DirectX";
+constexpr OUString AVMEDIA_WIN_WINDOW_SERVICENAME = 
u"com.sun.star.media.Window_DirectX"_ustr;
 
 using namespace ::com::sun::star;
 
diff --git a/basctl/source/basicide/baside3.cxx 
b/basctl/source/basicide/baside3.cxx
index 4b5d13fb6ecf..4a6b1dfbfb5c 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -70,7 +70,7 @@ using namespace ::com::sun::star::resource;
 using namespace ::com::sun::star::ui::dialogs;
 
 #ifdef _WIN32
-OUStringLiteral const FilterMask_All = u"*.*";
+constexpr OUString FilterMask_All = u"*.*"_ustr;
 #else
 constexpr OUString FilterMask_All = u"*"_ustr;
 #endif
diff --git a/embedserv/source/embed/intercept.cxx 
b/embedserv/source/embed/intercept.cxx
index bd849805bc2a..0f1566fd780d 100644
--- a/embedserv/source/embed/intercept.cxx
+++ b/embedserv/source/embed/intercept.cxx
@@ -27,12 +27,12 @@ using namespace ::com::sun::star;
 
 #define IUL 6
 
-constexpr OUStringLiteral IU0 = u".uno:Save";
-constexpr OUStringLiteral IU1 = u".uno:SaveAll";
-constexpr OUStringLiteral IU2 = u".uno:CloseDoc";
-constexpr OUStringLiteral IU3 = u".uno:CloseWin";
-constexpr OUStringLiteral IU4 = u".uno:CloseFrame";
-constexpr OUStringLiteral IU5 = u".uno:SaveAs";
+constexpr OUString IU0 = u".uno:Save"_ustr;
+constexpr OUString IU1 = u".uno:SaveAll"_ustr;
+constexpr OUString IU2 = u".uno:CloseDoc"_ustr;
+constexpr OUString IU3 = u".uno:CloseWin"_ustr;
+constexpr OUString IU4 = u".uno:CloseFrame"_ustr;
+constexpr OUString IU5 = u".uno:SaveAs"_ustr;
 const uno::Sequence< OUString > Interceptor::m_aInterceptedURL{ IU0, IU1, IU2, 
IU3, IU4, IU5};
 
 
diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx 
b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
index eda77b425ae5..9726c9869525 100644
--- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
+++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx
@@ -61,23 +61,23 @@ public:
 
 namespace
 {
-constexpr OUStringLiteral givenname(u"givenname");
-constexpr OUStringLiteral sn(u"sn");
+constexpr OUString givenname(u"givenname"_ustr);
+constexpr OUString sn(u"sn"_ustr);
 constexpr char fathersname[]("fathersname");
-constexpr OUStringLiteral initials(u"initials");
-constexpr OUStringLiteral street(u"street");
-constexpr OUStringLiteral l(u"l");
-constexpr OUStringLiteral st(u"st");
+constexpr OUString initials(u"initials"_ustr);
+constexpr OUString street(u"street"_ustr);
+constexpr OUString l(u"l"_ustr);
+constexpr OUString st(u"st"_ustr);
 constexpr char apartment[]("apartment");
-constexpr OUStringLiteral postalcode(u"postalcode");
-constexpr OUStringLiteral c(u"c");
-constexpr OUStringLiteral o(u"o");
+constexpr OUString postalcode(u"postalcode"_ustr);
+constexpr OUString c(u"c"_ustr);
+constexpr OUString o(u"o"_ustr);
 constexpr char position[]("position");
-constexpr OUStringLiteral title(u"title");
-constexpr OUStringLiteral homephone(u"homephone");
-constexpr OUStringLiteral telephonenumber(u"telephonenumber");
-constexpr OUStringLiteral 
facsimiletelephonenumber(u"facsimiletelephonenumber");
-constexpr OUStringLiteral mail(u"mail");
+constexpr OUString title(u"title"_ustr);
+constexpr OUString homephone(u"homephone"_ustr);
+constexpr OUString telephonenumber(u"telephonenumber"_ustr);
+constexpr OUString facsimiletelephonenumber(u"facsimiletelephonenumber"_ustr);
+constexpr OUString mail(u"mail"_ustr);
 
 // Backend class implementing access to Active Directory user data. It caches 
its encoded data
 // in a configuration entry, to allow reusing it when user later doesn't have 
access to AD DC
diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx 
b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
index 97c0c9fbd41e..7c21dcde0392 100644
--- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx
@@ -231,8 +231,8 @@ void VistaFilePickerEventHandler::stopListening()
     }
 }
 
-const OUStringLiteral PROP_CONTROL_ID = u"control_id";
-const OUStringLiteral PROP_PICKER_LISTENER = u"picker_listener";
+constexpr OUString PROP_CONTROL_ID = u"control_id"_ustr;
+constexpr OUString PROP_PICKER_LISTENER = u"picker_listener"_ustr;
 
 namespace {
 
diff --git a/fpicker/source/win32/VistaFilePickerImpl.hxx 
b/fpicker/source/win32/VistaFilePickerImpl.hxx
index 8e757c9c66ac..8ea9468076ea 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.hxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.hxx
@@ -57,26 +57,26 @@ const ::sal_Int32 FEATURE_VERSION        = 1024;
 const ::sal_Int32 FEATURE_GPGPASSWORD    = 2048;
 const ::sal_Int32 FEATURE_IMAGEANCHOR    = 4096;
 
-inline constexpr OUStringLiteral PROP_PICKER_LISTENER(u"picker_listener"   ); 
// [XFilePickerListenert]
-inline constexpr OUStringLiteral PROP_DIALOG_SHOW_RESULT(u"dialog_show_result" 
); // [sal_Bool] true=OK, false=CANCEL
-inline constexpr OUStringLiteral PROP_SELECTED_FILES(u"selected_files"     ); 
// [seq< OUString >] contains all user selected files (can be empty!)
-inline constexpr OUStringLiteral 
PROP_MULTISELECTION_MODE(u"multiselection_mode"); // [sal_Bool] true=ON, 
false=OFF
-inline constexpr OUStringLiteral PROP_TITLE(u"title"              ); // 
[OUString]
-inline constexpr OUStringLiteral PROP_FILENAME(u"filename"          ); // 
[OUString]
-inline constexpr OUStringLiteral PROP_DIRECTORY(u"directory"          ); // 
[OUString]
-inline constexpr OUStringLiteral PROP_FEATURES(u"features"           ); // 
[sal_Int32]
-inline constexpr OUStringLiteral PROP_TEMPLATE_DESCR(u"templatedescription"); 
// [sal_Int32]
-inline constexpr OUStringLiteral PROP_FILTER_TITLE(u"filter_title"       ); // 
[OUString]
-inline constexpr OUStringLiteral PROP_FILTER_VALUE(u"filter_value"       ); // 
[OUString]
-inline constexpr OUStringLiteral PROP_FILTER_GROUP(u"filter-group"       ); // 
[seq< css:beans::StringPair >] contains a group of filters
-
-inline constexpr OUStringLiteral PROP_CONTROL_ID(u"control_id"         ); // 
[sal_Int16]
-inline constexpr OUStringLiteral PROP_CONTROL_ACTION(u"control_action"     ); 
// [sal_Int16]
-inline constexpr OUStringLiteral PROP_CONTROL_VALUE(u"control_value"      ); 
// [Any]
-inline constexpr OUStringLiteral PROP_CONTROL_LABEL(u"control_label"      ); 
// [OUString]
-inline constexpr OUStringLiteral PROP_CONTROL_ENABLE(u"control_enable"     ); 
// [sal_Bool] true=ON, false=OFF
-inline constexpr OUStringLiteral PROP_PARENT_WINDOW(u"ParentWindow"); 
//[css::awt::XWindow] preferred parent window
-inline constexpr OUStringLiteral 
STRING_SEPARATOR(u"------------------------------------------" );
+inline constexpr OUString PROP_PICKER_LISTENER(u"picker_listener"_ustr   ); // 
[XFilePickerListenert]
+inline constexpr OUString PROP_DIALOG_SHOW_RESULT(u"dialog_show_result"_ustr 
); // [sal_Bool] true=OK, false=CANCEL
+inline constexpr OUString PROP_SELECTED_FILES(u"selected_files"_ustr     ); // 
[seq< OUString >] contains all user selected files (can be empty!)
+inline constexpr OUString 
PROP_MULTISELECTION_MODE(u"multiselection_mode"_ustr); // [sal_Bool] true=ON, 
false=OFF
+inline constexpr OUString PROP_TITLE(u"title"_ustr              ); // 
[OUString]
+inline constexpr OUString PROP_FILENAME(u"filename"_ustr          ); // 
[OUString]
+inline constexpr OUString PROP_DIRECTORY(u"directory"_ustr          ); // 
[OUString]
+inline constexpr OUString PROP_FEATURES(u"features"_ustr           ); // 
[sal_Int32]
+inline constexpr OUString PROP_TEMPLATE_DESCR(u"templatedescription"_ustr); // 
[sal_Int32]
+inline constexpr OUString PROP_FILTER_TITLE(u"filter_title"_ustr       ); // 
[OUString]
+inline constexpr OUString PROP_FILTER_VALUE(u"filter_value"_ustr       ); // 
[OUString]
+inline constexpr OUString PROP_FILTER_GROUP(u"filter-group"_ustr       ); // 
[seq< css:beans::StringPair >] contains a group of filters
+
+inline constexpr OUString PROP_CONTROL_ID(u"control_id"_ustr         ); // 
[sal_Int16]
+inline constexpr OUString PROP_CONTROL_ACTION(u"control_action"_ustr     ); // 
[sal_Int16]
+inline constexpr OUString PROP_CONTROL_VALUE(u"control_value"_ustr      ); // 
[Any]
+inline constexpr OUString PROP_CONTROL_LABEL(u"control_label"_ustr      ); // 
[OUString]
+inline constexpr OUString PROP_CONTROL_ENABLE(u"control_enable"_ustr     ); // 
[sal_Bool] true=ON, false=OFF
+inline constexpr OUString PROP_PARENT_WINDOW(u"ParentWindow"_ustr); 
//[css::awt::XWindow] preferred parent window
+inline constexpr OUString 
STRING_SEPARATOR(u"------------------------------------------"_ustr );
 
 class TDialogImplBase;
 
diff --git a/lingucomponent/source/lingutil/lingutil.cxx 
b/lingucomponent/source/lingutil/lingutil.cxx
index 781e91725e03..c737698417c5 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -53,7 +53,7 @@ using namespace ::com::sun::star;
 #if defined(_WIN32)
 OString Win_AddLongPathPrefix( const OString &rPathName )
 {
-  constexpr OStringLiteral WIN32_LONG_PATH_PREFIX = "\\\\?\\";
+  constexpr OString WIN32_LONG_PATH_PREFIX = "\\\\?\\"_ostr;
   if (!rPathName.match(WIN32_LONG_PATH_PREFIX)) return WIN32_LONG_PATH_PREFIX 
+ rPathName;
   return rPathName;
 }
diff --git a/sal/osl/w32/path_helper.cxx b/sal/osl/w32/path_helper.cxx
index a2dd134fded9..23a2412d91ac 100644
--- a/sal/osl/w32/path_helper.cxx
+++ b/sal/osl/w32/path_helper.cxx
@@ -25,8 +25,8 @@
 #include <algorithm>
 #include <wchar.h>
 
-constexpr OUStringLiteral BACKSLASH (u"\\");
-constexpr OUStringLiteral SLASH     (u"/");
+constexpr OUString BACKSLASH (u"\\"_ustr);
+constexpr OUString SLASH     (u"/"_ustr);
 
 void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath)
 {
@@ -57,7 +57,7 @@ void osl_systemPathRemoveSeparator(/*inout*/ rtl_uString** 
ppustrPath)
 
         if (i > -1 && (i == (path.getLength() - 1)))
         {
-            path = OUString(path.getStr(), path.getLength() - 1);
+            path = path.copy(0, path.getLength() - 1);
             rtl_uString_assign(ppustrPath, path.pData);
         }
     }
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index 1689d6ac6be9..a9a7b95cc2ce 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -344,11 +344,10 @@ namespace /* private */
                 ext.equalsIgnoreAsciiCase("btm"));
     }
 
-    const OUString ENV_COMSPEC ("COMSPEC");
     OUString get_batch_processor()
     {
         OUString comspec;
-        osl_getEnvironment(ENV_COMSPEC.pData, &comspec.pData);
+        osl_getEnvironment(u"COMSPEC"_ustr.pData, &comspec.pData);
 
         OSL_ASSERT(comspec.getLength());
 
diff --git a/sal/qa/rtl/process/rtl_Process.cxx 
b/sal/qa/rtl/process/rtl_Process.cxx
index 391f000c7cad..dc9eeed2ef23 100644
--- a/sal/qa/rtl/process/rtl_Process.cxx
+++ b/sal/qa/rtl/process/rtl_Process.cxx
@@ -67,7 +67,7 @@ public:
     void getAppCommandArg_001()
     {
 #if defined(_WIN32)
-        static constexpr OUStringLiteral EXECUTABLE_NAME(u"child_process.exe");
+        static constexpr OUString EXECUTABLE_NAME(u"child_process.exe"_ustr);
 #else
         static constexpr OUString EXECUTABLE_NAME(u"child_process"_ustr);
 #endif
@@ -196,7 +196,7 @@ public:
     void getGlobalProcessId_002()
     {
 #if defined(_WIN32)
-        static constexpr OUStringLiteral EXEC_NAME(u"child_process_id.exe");
+        static constexpr OUString EXEC_NAME(u"child_process_id.exe"_ustr);
 #else
         static constexpr OUString EXEC_NAME(u"child_process_id"_ustr);
 #endif
diff --git a/vcl/win/dtrans/MimeAttrib.hxx b/vcl/win/dtrans/MimeAttrib.hxx
index 875cb957add6..48dd5fc11e8c 100644
--- a/vcl/win/dtrans/MimeAttrib.hxx
+++ b/vcl/win/dtrans/MimeAttrib.hxx
@@ -21,11 +21,11 @@
 
 #include <rtl/ustring.hxx>
 
-const OUStringLiteral TEXTPLAIN_PARAM_CHARSET(u"charset");
+constexpr OUString TEXTPLAIN_PARAM_CHARSET(u"charset"_ustr);
 
-const OUStringLiteral PRE_WINDOWS_CODEPAGE(u"windows");
-const OUStringLiteral PRE_OEM_CODEPAGE(u"cp");
-const OUStringLiteral CHARSET_UTF16(u"utf-16");
-const OUStringLiteral CHARSET_UNICODE(u"unicode");
+constexpr OUString PRE_WINDOWS_CODEPAGE(u"windows"_ustr);
+constexpr OUString PRE_OEM_CODEPAGE(u"cp"_ustr);
+constexpr OUString CHARSET_UTF16(u"utf-16"_ustr);
+constexpr OUString CHARSET_UNICODE(u"unicode"_ustr);
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx
index ad41a95b0ae2..20056bba0ead 100644
--- a/vcl/win/dtrans/ftransl.cxx
+++ b/vcl/win/dtrans/ftransl.cxx
@@ -39,7 +39,7 @@
 #define CPPUTYPE_SEQSALINT8       cppu::UnoType<Sequence< sal_Int8 >>::get()
 #define CPPUTYPE_DEFAULT          CPPUTYPE_SEQSALINT8
 
-const OUStringLiteral Windows_FormatName = u"windows_formatname";
+constexpr OUString Windows_FormatName = u"windows_formatname"_ustr;
 const css::uno::Type CppuType_ByteSequence = 
cppu::UnoType<css::uno::Sequence<sal_Int8>>::get();
 const css::uno::Type CppuType_String       = ::cppu::UnoType<OUString>::get();
 

Reply via email to