UnoControls/source/inc/progressmonitor.hxx       |    4 +-
 include/xmlscript/xmlns.h                        |   14 +++++----
 sal/osl/unx/pipe.cxx                             |    8 ++---
 xmlhelp/source/cxxhelp/provider/provider.hxx     |    2 -
 xmlsecurity/inc/bitmaps.hlst                     |    8 ++---
 xmlsecurity/inc/xsecctl.hxx                      |   34 +++++++++++------------
 xmlsecurity/source/xmlsec/nss/nssinitializer.hxx |    2 -
 7 files changed, 37 insertions(+), 35 deletions(-)

New commits:
commit 6da12ca82d7bdcbe6f83e9cc46fdb560f729bd63
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Nov 30 11:26:30 2021 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Nov 30 14:07:26 2021 +0100

    loplugin:stringliteraldefine in various
    
    Change-Id: Ib482e3982128dc47d88a79478d80eef43745d1b0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126086
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/UnoControls/source/inc/progressmonitor.hxx 
b/UnoControls/source/inc/progressmonitor.hxx
index f8a463ca88a1..24f06380382b 100644
--- a/UnoControls/source/inc/progressmonitor.hxx
+++ b/UnoControls/source/inc/progressmonitor.hxx
@@ -37,8 +37,8 @@ namespace unocontrols {
 class ProgressBar;
 
 #define PROGRESSMONITOR_FREEBORDER                      10                     
                                 // border around and between the controls
-#define PROGRESSMONITOR_DEFAULT_TOPIC                   ""
-#define PROGRESSMONITOR_DEFAULT_TEXT                    ""
+inline constexpr OUStringLiteral PROGRESSMONITOR_DEFAULT_TOPIC  = u"";
+inline constexpr OUStringLiteral PROGRESSMONITOR_DEFAULT_TEXT = u"";
 #define PROGRESSMONITOR_LINECOLOR_BRIGHT                sal_Int32(Color( 0xFF, 
0xFF, 0xFF ))             // white
 #define PROGRESSMONITOR_LINECOLOR_SHADOW                sal_Int32(Color( 0x00, 
0x00, 0x00 ))             // black
 #define PROGRESSMONITOR_DEFAULT_WIDTH                   350
diff --git a/include/xmlscript/xmlns.h b/include/xmlscript/xmlns.h
index b1283afacae9..1b06d390fb02 100644
--- a/include/xmlscript/xmlns.h
+++ b/include/xmlscript/xmlns.h
@@ -18,19 +18,21 @@
  */
 #pragma once
 
-#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog";
+#include <rtl/ustring.hxx>
+
+inline constexpr OUStringLiteral XMLNS_DIALOGS_URI = 
u"http://openoffice.org/2000/dialog";;
 #define XMLNS_DIALOGS_PREFIX "dlg"
 
-#define XMLNS_SCRIPT_URI "http://openoffice.org/2000/script";
+inline constexpr OUStringLiteral XMLNS_SCRIPT_URI = 
u"http://openoffice.org/2000/script";;
 #define XMLNS_SCRIPT_PREFIX "script"
 
-#define XMLNS_OOO_URI "http://openoffice.org/2004/office";
-#define XMLNS_OOO_PREFIX "ooo"
+inline constexpr OUStringLiteral XMLNS_OOO_URI = 
u"http://openoffice.org/2004/office";;
+inline constexpr OUStringLiteral XMLNS_OOO_PREFIX = u"ooo";
 
-#define XMLNS_LIBRARY_URI "http://openoffice.org/2000/library";
+inline constexpr OUStringLiteral XMLNS_LIBRARY_URI = 
u"http://openoffice.org/2000/library";;
 #define XMLNS_LIBRARY_PREFIX "library"
 
-#define XMLNS_XLINK_URI "http://www.w3.org/1999/xlink";
+inline constexpr OUStringLiteral XMLNS_XLINK_URI = 
u"http://www.w3.org/1999/xlink";;
 #define XMLNS_XLINK_PREFIX "xlink"
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index d903bdd2f2de..45d31e00826b 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -36,8 +36,8 @@
 #include <cassert>
 #include <cstring>
 
-#define PIPEDEFAULTPATH     "/tmp"
-#define PIPEALTERNATEPATH   "/var/tmp"
+constexpr OStringLiteral PIPEDEFAULTPATH = "/tmp";
+constexpr OStringLiteral PIPEALTERNATEPATH = "/var/tmp";
 
 static oslPipe osl_psz_createPipe(const char *pszPipeName, oslPipeOptions 
Options, oslSecurity Security);
 
@@ -148,9 +148,9 @@ static oslPipe osl_psz_createPipe(const char *pszPipeName, 
oslPipeOptions Option
     OString name;
     oslPipe pPipe;
 
-    if (access(PIPEDEFAULTPATH, W_OK) == 0)
+    if (access(PIPEDEFAULTPATH.getStr(), W_OK) == 0)
         name = PIPEDEFAULTPATH;
-    else if (access(PIPEALTERNATEPATH, W_OK) == 0)
+    else if (access(PIPEALTERNATEPATH.getStr(), W_OK) == 0)
         name = PIPEALTERNATEPATH;
     else {
         name = getBootstrapSocketPath ();
diff --git a/xmlhelp/source/cxxhelp/provider/provider.hxx 
b/xmlhelp/source/cxxhelp/provider/provider.hxx
index dba65918a3d8..59ee39d828b3 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.hxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.hxx
@@ -35,7 +35,7 @@ namespace chelp {
 // contents ) according to this scheme.
 
 #define MYUCP_URL_SCHEME        "vnd.sun.star.help"
-#define MYUCP_CONTENT_TYPE      "application/vnd.sun.star.xmlhelp"    // UCB 
Content Type.
+inline constexpr OUStringLiteral MYUCP_CONTENT_TYPE = 
u"application/vnd.sun.star.xmlhelp";    // UCB Content Type.
 
     class Databases;
 
diff --git a/xmlsecurity/inc/bitmaps.hlst b/xmlsecurity/inc/bitmaps.hlst
index add5c78f59ef..2d4ccd0c4423 100644
--- a/xmlsecurity/inc/bitmaps.hlst
+++ b/xmlsecurity/inc/bitmaps.hlst
@@ -9,13 +9,13 @@
 
 #pragma once
 
-#define BMP_STATE_NOT_VALIDATED         
"xmlecurity/res/notcertificate_40x56.png"
+inline constexpr OUStringLiteral BMP_STATE_NOT_VALIDATED = 
u"xmlecurity/res/notcertificate_40x56.png";
 
 #define BMP_CERT_OK                     "xmlsecurity/res/certificate_16.png"
 #define BMP_CERT_NOT_OK                 "xmlsecurity/res/notcertificate_16.png"
 
-#define BMP_SIG_VALID                   "xmlsecurity/res/signet_11x16.png"
-#define BMP_SIG_INVALID                 "svx/res/caution_11x16.png"
-#define BMP_SIG_NOT_VALIDATED           "xmlsecurity/res/notcertificate_16.png"
+inline constexpr OUStringLiteral BMP_SIG_VALID = 
u"xmlsecurity/res/signet_11x16.png";
+inline constexpr OUStringLiteral BMP_SIG_INVALID = 
u"svx/res/caution_11x16.png";
+inline constexpr OUStringLiteral BMP_SIG_NOT_VALIDATED = 
u"xmlsecurity/res/notcertificate_16.png";
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx
index 91e334260b70..2d105c8690d2 100644
--- a/xmlsecurity/inc/xsecctl.hxx
+++ b/xmlsecurity/inc/xsecctl.hxx
@@ -42,23 +42,23 @@ namespace com::sun::star::xml::crypto { class 
XXMLSignature; }
 namespace com::sun::star::xml::crypto:: sax { class 
XReferenceResolvedListener; }
 namespace com::sun::star::xml::sax { class XDocumentHandler; }
 
-#define NS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#";
-#define NS_DC      "http://purl.org/dc/elements/1.1/";
-#define NS_XD      "http://uri.etsi.org/01903/v1.3.2#";
-#define NS_MDSSI   
"http://schemas.openxmlformats.org/package/2006/digital-signature";
-#define NS_LOEXT   
"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
-
-#define ALGO_C14N          "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
-#define ALGO_RSASHA1       "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
-#define ALGO_RSASHA256     "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
-#define ALGO_RSASHA512     "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
-#define ALGO_ECDSASHA1     "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1";
-#define ALGO_ECDSASHA256   
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256";
-#define ALGO_ECDSASHA512   
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";
-#define ALGO_XMLDSIGSHA1   "http://www.w3.org/2000/09/xmldsig#sha1";
-#define ALGO_XMLDSIGSHA256 "http://www.w3.org/2001/04/xmlenc#sha256";
-#define ALGO_XMLDSIGSHA512 "http://www.w3.org/2001/04/xmlenc#sha512";
-#define ALGO_RELATIONSHIP  
"http://schemas.openxmlformats.org/package/2006/RelationshipTransform";
+inline constexpr OUStringLiteral NS_XMLDSIG = 
u"http://www.w3.org/2000/09/xmldsig#";;
+inline constexpr OUStringLiteral NS_DC = u"http://purl.org/dc/elements/1.1/";;
+inline constexpr OUStringLiteral NS_XD = u"http://uri.etsi.org/01903/v1.3.2#";;
+inline constexpr OUStringLiteral NS_MDSSI = 
u"http://schemas.openxmlformats.org/package/2006/digital-signature";;
+inline constexpr OUStringLiteral NS_LOEXT = 
u"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0";
+
+inline constexpr OUStringLiteral ALGO_C14N = 
u"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";;
+inline constexpr OUStringLiteral ALGO_RSASHA1 = 
u"http://www.w3.org/2000/09/xmldsig#rsa-sha1";;
+inline constexpr OUStringLiteral ALGO_RSASHA256 = 
u"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";;
+inline constexpr OUStringLiteral ALGO_RSASHA512 = 
u"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";;
+inline constexpr OUStringLiteral ALGO_ECDSASHA1 = 
u"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1";;
+inline constexpr OUStringLiteral ALGO_ECDSASHA256 = 
u"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256";;
+inline constexpr OUStringLiteral ALGO_ECDSASHA512 = 
u"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";;
+inline constexpr OUStringLiteral ALGO_XMLDSIGSHA1 = 
u"http://www.w3.org/2000/09/xmldsig#sha1";;
+inline constexpr OUStringLiteral ALGO_XMLDSIGSHA256 = 
u"http://www.w3.org/2001/04/xmlenc#sha256";;
+inline constexpr OUStringLiteral ALGO_XMLDSIGSHA512 = 
u"http://www.w3.org/2001/04/xmlenc#sha512";;
+inline constexpr OUStringLiteral ALGO_RELATIONSHIP = 
u"http://schemas.openxmlformats.org/package/2006/RelationshipTransform";;
 
 class XMLDocumentWrapper_XmlSecImpl;
 class SAXEventKeeperImpl;
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx 
b/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx
index f0c731560ab3..fa861c298cab 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.hxx
@@ -26,7 +26,7 @@
 
 namespace com::sun::star::uno { class XComponentContext; }
 
-#define NSS_SERVICE_NAME "com.sun.star.xml.crypto.NSSInitializer"
+inline constexpr OUStringLiteral NSS_SERVICE_NAME = 
u"com.sun.star.xml.crypto.NSSInitializer";
 
 class ONSSInitializer : public cppu::WeakImplHelper
 <

Reply via email to