summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 15:08:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-02 14:43:58 +0200
commit1597cc5b3e07dd24cb4cb10b35b1e93545e4b929 (patch)
treef6ed37244e41d23e8a84327b1580e37f3dc18829 /ucb
parent0e883d6dbee8d72257f77605ae0c8a1d5bfbf044 (diff)
convert #defines to OUStringLiteral
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/FileAccess.cxx2
-rw-r--r--ucb/source/core/ucbstore.cxx4
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydata.cxx6
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydatasource.cxx11
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyuri.cxx33
-rw-r--r--ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx4
-rw-r--r--ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx4
-rw-r--r--ucb/source/ucp/webdav/SerfSession.cxx2
8 files changed, 32 insertions, 34 deletions
diff --git a/ucb/source/core/FileAccess.cxx b/ucb/source/core/FileAccess.cxx
index 8e93248bd192..88dfd9dadc3c 100644
--- a/ucb/source/core/FileAccess.cxx
+++ b/ucb/source/core/FileAccess.cxx
@@ -53,7 +53,7 @@
#include <vector>
-#define SERVICE_NAME "com.sun.star.ucb.SimpleFileAccess"
+constexpr OUStringLiteral SERVICE_NAME = u"com.sun.star.ucb.SimpleFileAccess";
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 139faf8c2038..a038ff27222f 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -100,10 +100,10 @@ static OUString makeHierarchalNameSegment( const OUString & rIn )
return aBuffer.makeStringAndClear();
}
-#define STORE_CONTENTPROPERTIES_KEY "/org.openoffice.ucb.Store/ContentProperties"
+constexpr OUStringLiteral STORE_CONTENTPROPERTIES_KEY = u"/org.openoffice.ucb.Store/ContentProperties";
// describe path of cfg entry
-#define CFGPROPERTY_NODEPATH "nodepath"
+constexpr OUStringLiteral CFGPROPERTY_NODEPATH = u"nodepath";
class PropertySetInfo_Impl : public cppu::WeakImplHelper < XPropertySetInfo >
{
diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx
index 8df1200f55c9..737ef9809044 100644
--- a/ucb/source/ucp/hierarchy/hierarchydata.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx
@@ -85,11 +85,11 @@ static void makeXMLName( const OUString & rIn, OUStringBuffer & rBuffer )
// HierarchyEntry Implementation.
-#define READ_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadAccess"
-#define READWRITE_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadWriteAccess"
+constexpr OUStringLiteral READ_SERVICE_NAME = u"com.sun.star.ucb.HierarchyDataReadAccess";
+constexpr OUStringLiteral READWRITE_SERVICE_NAME = u"com.sun.star.ucb.HierarchyDataReadWriteAccess";
// describe path of cfg entry
-#define CFGPROPERTY_NODEPATH "nodepath"
+constexpr OUStringLiteral CFGPROPERTY_NODEPATH = u"nodepath";
HierarchyEntry::HierarchyEntry(
diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
index 253a1d8e79a7..5970ba178a7d 100644
--- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx
@@ -46,13 +46,12 @@ using namespace hierarchy_ucp;
// describe path of cfg entry
-#define CFGPROPERTY_NODEPATH "nodepath"
+constexpr OUStringLiteral CFGPROPERTY_NODEPATH = u"nodepath";
-#define READ_SERVICE_NAME u"com.sun.star.ucb.HierarchyDataReadAccess"
-#define READWRITE_SERVICE_NAME u"com.sun.star.ucb.HierarchyDataReadWriteAccess"
+constexpr OUStringLiteral READ_SERVICE_NAME = u"com.sun.star.ucb.HierarchyDataReadAccess";
+constexpr OUStringLiteral READWRITE_SERVICE_NAME = u"com.sun.star.ucb.HierarchyDataReadWriteAccess";
-#define CONFIG_DATA_ROOT_KEY \
- "/org.openoffice.ucb.Hierarchy/Root"
+constexpr OUStringLiteral CONFIG_DATA_ROOT_KEY = u"/org.openoffice.ucb.Hierarchy/Root";
namespace hcp_impl
@@ -461,7 +460,7 @@ bool HierarchyDataSource::createConfigPath(
return false;
}
- rOutPath = CONFIG_DATA_ROOT_KEY "/" + rInPath;
+ rOutPath = CONFIG_DATA_ROOT_KEY + "/" + rInPath;
}
else
{
diff --git a/ucb/source/ucp/hierarchy/hierarchyuri.cxx b/ucb/source/ucp/hierarchy/hierarchyuri.cxx
index d936b810a3ab..90aab6235ef1 100644
--- a/ucb/source/ucp/hierarchy/hierarchyuri.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyuri.cxx
@@ -28,10 +28,9 @@
using namespace hierarchy_ucp;
-#define HIERARCHY_URL_SCHEME "vnd.sun.star.hier"
-#define HIERARCHY_URL_SCHEME_LENGTH 17
-#define DEFAULT_DATA_SOURCE_SERVICE \
- "com.sun.star.ucb.DefaultHierarchyDataSource"
+constexpr OUStringLiteral HIERARCHY_URL_SCHEME = u"vnd.sun.star.hier";
+constexpr OUStringLiteral DEFAULT_DATA_SOURCE_SERVICE =
+ u"com.sun.star.ucb.DefaultHierarchyDataSource";
// HierarchyUri Implementation.
@@ -48,7 +47,7 @@ void HierarchyUri::init() const
m_aParentUri.clear();
// URI must match at least: <scheme>:
- if ( m_aUri.getLength() < HIERARCHY_URL_SCHEME_LENGTH + 1 )
+ if ( m_aUri.getLength() < HIERARCHY_URL_SCHEME.getLength() + 1 )
{
// error, but remember that we did an init().
m_aPath = "/";
@@ -57,7 +56,7 @@ void HierarchyUri::init() const
// Scheme is case insensitive.
OUString aScheme
- = m_aUri.copy( 0, HIERARCHY_URL_SCHEME_LENGTH ).toAsciiLowerCase();
+ = m_aUri.copy( 0, HIERARCHY_URL_SCHEME.getLength() ).toAsciiLowerCase();
if ( aScheme == HIERARCHY_URL_SCHEME )
{
m_aUri = m_aUri.replaceAt( 0, aScheme.getLength(), aScheme );
@@ -67,42 +66,42 @@ void HierarchyUri::init() const
// If the URI has no service specifier, insert default service.
// This is for backward compatibility and for convenience.
- if ( m_aUri.getLength() == HIERARCHY_URL_SCHEME_LENGTH + 1 )
+ if ( m_aUri.getLength() == HIERARCHY_URL_SCHEME.getLength() + 1 )
{
// root folder URI without path and service specifier.
- m_aUri += "//" DEFAULT_DATA_SOURCE_SERVICE "/";
+ m_aUri += "//" + DEFAULT_DATA_SOURCE_SERVICE + "/";
m_aService = DEFAULT_DATA_SOURCE_SERVICE ;
nPos = m_aUri.getLength() - 1;
}
- else if ( ( m_aUri.getLength() == HIERARCHY_URL_SCHEME_LENGTH + 2 )
+ else if ( ( m_aUri.getLength() == HIERARCHY_URL_SCHEME.getLength() + 2 )
&&
- ( m_aUri[ HIERARCHY_URL_SCHEME_LENGTH + 1 ] == '/' ) )
+ ( m_aUri[ HIERARCHY_URL_SCHEME.getLength() + 1 ] == '/' ) )
{
// root folder URI without service specifier.
- m_aUri += "/" DEFAULT_DATA_SOURCE_SERVICE "/";
+ m_aUri += "/" + DEFAULT_DATA_SOURCE_SERVICE + "/";
m_aService = DEFAULT_DATA_SOURCE_SERVICE;
nPos = m_aUri.getLength() - 1;
}
- else if ( ( m_aUri.getLength() > HIERARCHY_URL_SCHEME_LENGTH + 2 )
+ else if ( ( m_aUri.getLength() > HIERARCHY_URL_SCHEME.getLength() + 2 )
&&
- ( m_aUri[ HIERARCHY_URL_SCHEME_LENGTH + 2 ] != '/' ) )
+ ( m_aUri[ HIERARCHY_URL_SCHEME.getLength() + 2 ] != '/' ) )
{
// other (no root folder) URI without service specifier.
m_aUri = m_aUri.replaceAt(
- HIERARCHY_URL_SCHEME_LENGTH + 2,
+ HIERARCHY_URL_SCHEME.getLength() + 2,
0,
- "/" DEFAULT_DATA_SOURCE_SERVICE "/" );
+ "/" + DEFAULT_DATA_SOURCE_SERVICE + "/" );
m_aService = DEFAULT_DATA_SOURCE_SERVICE;
nPos
- = HIERARCHY_URL_SCHEME_LENGTH + 3 + m_aService.getLength();
+ = HIERARCHY_URL_SCHEME.getLength() + 3 + m_aService.getLength();
}
else
{
// URI with service specifier.
- sal_Int32 nStart = HIERARCHY_URL_SCHEME_LENGTH + 3;
+ sal_Int32 nStart = HIERARCHY_URL_SCHEME.getLength() + 3;
// Here: - m_aUri has at least the form "<scheme>://"
// - nStart points to char after <scheme>:
diff --git a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
index 39a471fee893..bedf9b7e3271 100644
--- a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
@@ -80,8 +80,8 @@ SerfPropFindReqProcImpl::~SerfPropFindReqProcImpl()
{
}
-#define PROPFIND_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">"
-#define PROPFIND_TRAILER "</propfind>"
+constexpr OUStringLiteral PROPFIND_HEADER = u"<?xml version=\"1.0\" encoding=\"utf-8\"?><propfind xmlns=\"DAV:\">";
+constexpr OUStringLiteral PROPFIND_TRAILER = u"</propfind>";
serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
{
diff --git a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
index 4540ccbd0124..1cde357ec454 100644
--- a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
@@ -39,8 +39,8 @@ SerfPropPatchReqProcImpl::~SerfPropPatchReqProcImpl()
{
}
-#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">"
-#define PROPPATCH_TRAILER "</propertyupdate>"
+constexpr OUStringLiteral PROPPATCH_HEADER = u"<?xml version=\"1.0\" encoding=\"utf-8\"?><propertyupdate xmlns=\"DAV:\">";
+constexpr OUStringLiteral PROPPATCH_TRAILER = u"</propertyupdate>";
serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_t * inSerfRequest )
{
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 8f7a7e38c754..2f1b4d2626c9 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/io/NotConnectedException.hpp>
#include <com/sun/star/io/BufferSizeExceededException.hpp>
#include <com/sun/star/io/IOException.hpp>
-#define OID_SUBJECT_ALTERNATIVE_NAME "2.5.29.17"
+constexpr OUStringLiteral OID_SUBJECT_ALTERNATIVE_NAME = u"2.5.29.17";
#include <com/sun/star/ucb/Lock.hpp>
#include <com/sun/star/xml/crypto/XSEInitializer.hpp>