ucb/source/core/ucbcmds.hxx                    |    6 +++---
 ucb/source/sorter/sortresult.hxx               |    2 +-
 ucb/source/ucp/cmis/cmis_content.cxx           |    7 ++++---
 ucb/source/ucp/cmis/cmis_content.hxx           |    4 ++--
 ucb/source/ucp/cmis/cmis_repo_content.hxx      |    2 +-
 ucb/source/ucp/cmis/cmis_strings.hxx           |   10 +++++-----
 ucb/source/ucp/ftp/ftpcontentprovider.hxx      |    4 ++--
 ucb/source/ucp/gio/gio_content.hxx             |    4 ++--
 ucb/source/ucp/hierarchy/hierarchyprovider.hxx |    8 ++++----
 ucb/source/ucp/tdoc/tdoc_provider.hxx          |   16 ++++++++--------
 ucb/source/ucp/webdav-curl/webdavcontent.hxx   |    2 +-
 ucb/source/ucp/webdav-curl/webdavprovider.hxx  |    6 +++---
 ucb/source/ucp/webdav-neon/webdavcontent.hxx   |    2 +-
 ucb/source/ucp/webdav-neon/webdavprovider.hxx  |   12 ++++++------
 14 files changed, 43 insertions(+), 42 deletions(-)

New commits:
commit 1d16a2c3aed633bf594675e116327e09fe4d898d
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Nov 26 11:32:46 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Nov 29 12:21:44 2021 +0100

    loplugin:stringliteraldefine in ucb
    
    Change-Id: I3b2e01b482f7f4dbceea090b9586cdb4eee4e703
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125869
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucb/source/core/ucbcmds.hxx b/ucb/source/core/ucbcmds.hxx
index 1196e1340028..c34a3564d4ae 100644
--- a/ucb/source/core/ucbcmds.hxx
+++ b/ucb/source/core/ucbcmds.hxx
@@ -23,13 +23,13 @@
 // Definitions for the commands supported by the UCB.
 
 
-#define GETCOMMANDINFO_NAME     "getCommandInfo"
+inline constexpr OUStringLiteral GETCOMMANDINFO_NAME = u"getCommandInfo";
 #define GETCOMMANDINFO_HANDLE   1024
 
-#define GLOBALTRANSFER_NAME     "globalTransfer"
+inline constexpr OUStringLiteral GLOBALTRANSFER_NAME = u"globalTransfer";
 #define GLOBALTRANSFER_HANDLE   1025
 
-#define CHECKIN_NAME            "checkin"
+inline constexpr OUStringLiteral CHECKIN_NAME = u"checkin";
 #define CHECKIN_HANDLE          1026
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx
index 9593e7699b7c..7db1c97fb61a 100644
--- a/ucb/source/sorter/sortresult.hxx
+++ b/ucb/source/sorter/sortresult.hxx
@@ -83,7 +83,7 @@ public:
 };
 
 
-#define RESULTSET_SERVICE_NAME  "com.sun.star.ucb.SortedResultSet"
+inline constexpr OUStringLiteral RESULTSET_SERVICE_NAME = 
u"com.sun.star.ucb.SortedResultSet";
 
 
 class SortedResultSet: public cppu::WeakImplHelper <
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx 
b/ucb/source/ucp/cmis/cmis_content.cxx
index 7980a1821bba..9cc4e5ca2511 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1738,9 +1738,10 @@ namespace cmis
         OUString sRet;
         try
         {
-            sRet = isFolder( uno::Reference< ucb::XCommandEnvironment >() )
-                ? std::u16string_view(u"" CMIS_FOLDER_TYPE)
-                : std::u16string_view(u"" CMIS_FILE_TYPE);
+            if (isFolder( uno::Reference< ucb::XCommandEnvironment >() ))
+                sRet = CMIS_FOLDER_TYPE;
+            else
+                sRet = CMIS_FILE_TYPE;
         }
         catch (const uno::RuntimeException&)
         {
diff --git a/ucb/source/ucp/cmis/cmis_content.hxx 
b/ucb/source/ucp/cmis/cmis_content.hxx
index 54d7b6e41b08..23546ce14a3e 100644
--- a/ucb/source/ucp/cmis/cmis_content.hxx
+++ b/ucb/source/ucp/cmis/cmis_content.hxx
@@ -55,8 +55,8 @@ namespace ucbhelper
 namespace cmis
 {
 
-#define CMIS_FILE_TYPE   "application/vnd.libreoffice.cmis-file"
-#define CMIS_FOLDER_TYPE "application/vnd.libreoffice.cmis-folder"
+inline constexpr OUStringLiteral CMIS_FILE_TYPE = 
u"application/vnd.libreoffice.cmis-file";
+inline constexpr OUStringLiteral CMIS_FOLDER_TYPE = 
u"application/vnd.libreoffice.cmis-folder";
 
 class ContentProvider;
 class Content : public ::ucbhelper::ContentImplHelper,
diff --git a/ucb/source/ucp/cmis/cmis_repo_content.hxx 
b/ucb/source/ucp/cmis/cmis_repo_content.hxx
index efd13d7d8cbf..0b68c4960e93 100644
--- a/ucb/source/ucp/cmis/cmis_repo_content.hxx
+++ b/ucb/source/ucp/cmis/cmis_repo_content.hxx
@@ -41,7 +41,7 @@ namespace ucbhelper
 
 namespace cmis
 {
-#define CMIS_REPO_TYPE   "application/vnd.libreoffice.cmis-repository"
+inline constexpr OUStringLiteral CMIS_REPO_TYPE = 
u"application/vnd.libreoffice.cmis-repository";
 
 class ContentProvider;
 class RepoContent : public ::ucbhelper::ContentImplHelper,
diff --git a/ucb/source/ucp/cmis/cmis_strings.hxx 
b/ucb/source/ucp/cmis/cmis_strings.hxx
index 76a9d469022d..0a7b81d24e70 100644
--- a/ucb/source/ucp/cmis/cmis_strings.hxx
+++ b/ucb/source/ucp/cmis/cmis_strings.hxx
@@ -12,10 +12,10 @@
 
 #pragma once
 
-#define CMIS_TYPE_STRING      "String"
-#define CMIS_TYPE_INTEGER     "Integer"
-#define CMIS_TYPE_DECIMAL     "Decimal"
-#define CMIS_TYPE_DATETIME    "Datetime"
-#define CMIS_TYPE_BOOL        "Bool"
+inline constexpr OUStringLiteral CMIS_TYPE_STRING = u"String";
+inline constexpr OUStringLiteral CMIS_TYPE_INTEGER = u"Integer";
+inline constexpr OUStringLiteral CMIS_TYPE_DECIMAL = u"Decimal";
+inline constexpr OUStringLiteral CMIS_TYPE_DATETIME = u"Datetime";
+inline constexpr OUStringLiteral CMIS_TYPE_BOOL = u"Bool";
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.hxx 
b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
index 3547de0f2a50..fe1247b9e756 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.hxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.hxx
@@ -29,8 +29,8 @@
 // UNO service name for the provider. This name will be used by the UCB to
 // create instances of the provider.
 
-#define FTP_CONTENT_PROVIDER_SERVICE_NAME "com.sun.star.ucb.FTPContentProvider"
-#define FTP_CONTENT_TYPE "application/ftp-content"
+inline constexpr OUStringLiteral FTP_CONTENT_PROVIDER_SERVICE_NAME  = 
u"com.sun.star.ucb.FTPContentProvider";
+inline constexpr OUStringLiteral FTP_CONTENT_TYPE  = 
u"application/ftp-content";
 
 /**
  *  Definition of ftpcontentprovider
diff --git a/ucb/source/ucp/gio/gio_content.hxx 
b/ucb/source/ucp/gio/gio_content.hxx
index e92eb57e56e5..0c80da5cdac4 100644
--- a/ucb/source/ucp/gio/gio_content.hxx
+++ b/ucb/source/ucp/gio/gio_content.hxx
@@ -49,8 +49,8 @@ namespace gio
 {
 
 
-#define GIO_FILE_TYPE   "application/vnd.sun.staroffice.gio-file"
-#define GIO_FOLDER_TYPE "application/vnd.sun.staroffice.gio-folder"
+inline constexpr OUStringLiteral GIO_FILE_TYPE = 
u"application/vnd.sun.staroffice.gio-file";
+inline constexpr OUStringLiteral GIO_FOLDER_TYPE = 
u"application/vnd.sun.staroffice.gio-folder";
 
 css::uno::Any convertToException(GError *pError,
     const css::uno::Reference< css::uno::XInterface >& rContext, bool 
bThrow=true);
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx 
b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
index 55edb8448ebe..5ac80de3faed 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx
@@ -41,10 +41,10 @@ namespace hierarchy_ucp {
                 "vnd.sun.star.hier"
 #define HIERARCHY_URL_SCHEME_LENGTH 17
 
-#define HIERARCHY_FOLDER_CONTENT_TYPE \
-                "application/" HIERARCHY_URL_SCHEME "-folder"
-#define HIERARCHY_LINK_CONTENT_TYPE \
-                "application/" HIERARCHY_URL_SCHEME "-link"
+inline constexpr OUStringLiteral HIERARCHY_FOLDER_CONTENT_TYPE =
+                u"application/" HIERARCHY_URL_SCHEME "-folder";
+inline constexpr OUStringLiteral HIERARCHY_LINK_CONTENT_TYPE =
+                u"application/" HIERARCHY_URL_SCHEME "-link";
 
 struct ConfigProviderMapEntry
 {
diff --git a/ucb/source/ucp/tdoc/tdoc_provider.hxx 
b/ucb/source/ucp/tdoc/tdoc_provider.hxx
index 44bc239f7c6e..813b9d1103d9 100644
--- a/ucb/source/ucp/tdoc/tdoc_provider.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_provider.hxx
@@ -44,14 +44,14 @@ namespace com::sun::star::frame {
 namespace tdoc_ucp {
 
 
-#define TDOC_ROOT_CONTENT_TYPE \
-                u"application/" TDOC_URL_SCHEME "-root"
-#define TDOC_DOCUMENT_CONTENT_TYPE \
-                u"application/" TDOC_URL_SCHEME "-document"
-#define TDOC_FOLDER_CONTENT_TYPE \
-                u"application/" TDOC_URL_SCHEME "-folder"
-#define TDOC_STREAM_CONTENT_TYPE \
-                u"application/" TDOC_URL_SCHEME "-stream"
+inline constexpr OUStringLiteral TDOC_ROOT_CONTENT_TYPE =
+                u"application/" TDOC_URL_SCHEME "-root";
+inline constexpr OUStringLiteral TDOC_DOCUMENT_CONTENT_TYPE =
+                u"application/" TDOC_URL_SCHEME "-document";
+inline constexpr OUStringLiteral TDOC_FOLDER_CONTENT_TYPE =
+                u"application/" TDOC_URL_SCHEME "-folder";
+inline constexpr OUStringLiteral TDOC_STREAM_CONTENT_TYPE =
+                u"application/" TDOC_URL_SCHEME "-stream";
 
 
 class StorageElementFactory;
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.hxx 
b/ucb/source/ucp/webdav-curl/webdavcontent.hxx
index 43c275cd2e7f..a44eb1c99d43 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.hxx
@@ -54,7 +54,7 @@ namespace http_dav_ucp
 
 
 // UNO service name for the content.
-#define WEBDAV_CONTENT_SERVICE_NAME "com.sun.star.ucb.WebDAVContent"
+inline constexpr OUStringLiteral WEBDAV_CONTENT_SERVICE_NAME = 
u"com.sun.star.ucb.WebDAVContent";
 
 
 class ContentProvider;
diff --git a/ucb/source/ucp/webdav-curl/webdavprovider.hxx 
b/ucb/source/ucp/webdav-curl/webdavprovider.hxx
index e9e065007417..a05377cfeb9f 100644
--- a/ucb/source/ucp/webdav-curl/webdavprovider.hxx
+++ b/ucb/source/ucp/webdav-curl/webdavprovider.hxx
@@ -39,7 +39,7 @@ namespace http_dav_ucp {
 
 // UNO service name for the provider. This name will be used by the UCB to
 // create instances of the provider.
-#define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME 
"com.sun.star.ucb.WebDAVContentProvider"
+inline constexpr OUStringLiteral WEBDAV_CONTENT_PROVIDER_SERVICE_NAME = 
u"com.sun.star.ucb.WebDAVContentProvider";
 
 // URL scheme. This is the scheme the provider will be able to create
 // contents for. The UCB will select the provider ( i.e. in order to create
@@ -53,10 +53,10 @@ namespace http_dav_ucp {
 #define WEBDAV_URL_SCHEME            u"webdav"
 #define WEBDAVS_URL_SCHEME           u"webdavs"
 
-#define HTTP_CONTENT_TYPE      "application/" HTTP_URL_SCHEME "-content"
+inline constexpr OUStringLiteral HTTP_CONTENT_TYPE = u"application/" 
HTTP_URL_SCHEME "-content";
 
 #define WEBDAV_CONTENT_TYPE    HTTP_CONTENT_TYPE
-#define WEBDAV_COLLECTION_TYPE "application/" VNDSUNSTARWEBDAV_URL_SCHEME 
"-collection"
+inline constexpr OUStringLiteral WEBDAV_COLLECTION_TYPE = u"application/" 
VNDSUNSTARWEBDAV_URL_SCHEME "-collection";
 
 
 class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx 
b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
index f00f9a02465e..74dfb1624b75 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
@@ -63,7 +63,7 @@ namespace webdav_ucp
 
 
 // UNO service name for the content.
-#define WEBDAV_CONTENT_SERVICE_NAME "com.sun.star.ucb.WebDAVContent"
+inline constexpr OUStringLiteral WEBDAV_CONTENT_SERVICE_NAME = 
u"com.sun.star.ucb.WebDAVContent";
 
 
 class ContentProvider;
diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.hxx 
b/ucb/source/ucp/webdav-neon/webdavprovider.hxx
index 439ace674be9..7aca1b48a2b9 100644
--- a/ucb/source/ucp/webdav-neon/webdavprovider.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavprovider.hxx
@@ -42,15 +42,15 @@ namespace webdav_ucp {
 
 // UNO service name for the provider. This name will be used by the UCB to
 // create instances of the provider.
-#define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME 
"com.sun.star.ucb.WebDAVContentProvider"
+inline constexpr OUStringLiteral WEBDAV_CONTENT_PROVIDER_SERVICE_NAME 
=u"com.sun.star.ucb.WebDAVContentProvider";
 
 // URL scheme. This is the scheme the provider will be able to create
 // contents for. The UCB will select the provider ( i.e. in order to create
 // contents ) according to this scheme.
 #define VNDSUNSTARWEBDAV_URL_SCHEME  "vnd.sun.star.webdav"
 #define VNDSUNSTARWEBDAVS_URL_SCHEME u"vnd.sun.star.webdavs"
-#define HTTP_URL_SCHEME              "http"
-#define HTTPS_URL_SCHEME             "https"
+inline constexpr OUStringLiteral HTTP_URL_SCHEME = u"http";
+inline constexpr OUStringLiteral HTTPS_URL_SCHEME = u"https";
 #define DAV_URL_SCHEME               u"dav"
 #define DAVS_URL_SCHEME              u"davs"
 #define WEBDAV_URL_SCHEME            u"webdav"
@@ -58,10 +58,10 @@ namespace webdav_ucp {
 
 #define FTP_URL_SCHEME "ftp"
 
-#define HTTP_CONTENT_TYPE      "application/" HTTP_URL_SCHEME "-content"
+#define HTTP_CONTENT_TYPE      ("application/" + HTTP_URL_SCHEME + "-content")
 
-#define WEBDAV_CONTENT_TYPE    HTTP_CONTENT_TYPE
-#define WEBDAV_COLLECTION_TYPE "application/" VNDSUNSTARWEBDAV_URL_SCHEME 
"-collection"
+#define WEBDAV_CONTENT_TYPE HTTP_CONTENT_TYPE
+inline constexpr OUStringLiteral WEBDAV_COLLECTION_TYPE = u"application/" 
VNDSUNSTARWEBDAV_URL_SCHEME "-collection";
 
 
 class ContentProvider : public ::ucbhelper::ContentProviderImplHelper

Reply via email to