summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 10:55:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-13 08:16:03 +0200
commit3457da6abe0fd03efd19442e9790fbd1aa04c160 (patch)
treea7a2d5b51839b200e7cda79af863dce7a04d3a10 /ucb
parent47196637a41ddfc9a8707771b1b9f482fd72c3b6 (diff)
loplugin:stringstatic also look for local statics
Add some API to O*StringLiteral, to make it easier to use in some places that were using O*String Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-neon/DAVProperties.cxx49
-rw-r--r--ucb/source/ucp/webdav-neon/DAVProperties.hxx24
2 files changed, 36 insertions, 37 deletions
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
index 5d5634936dca..3d6bb94dc115 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx
@@ -32,19 +32,18 @@
using namespace webdav_ucp;
-const OUString DAVProperties::CREATIONDATE("DAV:creationdate");
-const OUString DAVProperties::DISPLAYNAME("DAV:displayname");
-const OUString DAVProperties::GETCONTENTLANGUAGE("DAV:getcontentlanguage");
-const OUString DAVProperties::GETCONTENTLENGTH("DAV:getcontentlength");
-const OUString DAVProperties::GETCONTENTTYPE("DAV:getcontenttype");
-const OUString DAVProperties::GETETAG("DAV:getetag");
-const OUString DAVProperties::GETLASTMODIFIED("DAV:getlastmodified");
-const OUString DAVProperties::LOCKDISCOVERY("DAV:lockdiscovery");
-const OUString DAVProperties::RESOURCETYPE("DAV:resourcetype");
-const OUString DAVProperties::SOURCE("DAV:source");
-const OUString DAVProperties::SUPPORTEDLOCK("DAV:supportedlock");
-
-const OUString DAVProperties::EXECUTABLE("http://apache.org/dav/props/executable");
+const OUStringLiteral DAVProperties::CREATIONDATE("DAV:creationdate");
+const OUStringLiteral DAVProperties::DISPLAYNAME("DAV:displayname");
+const OUStringLiteral DAVProperties::GETCONTENTLANGUAGE("DAV:getcontentlanguage");
+const OUStringLiteral DAVProperties::GETCONTENTLENGTH("DAV:getcontentlength");
+const OUStringLiteral DAVProperties::GETCONTENTTYPE("DAV:getcontenttype");
+const OUStringLiteral DAVProperties::GETETAG("DAV:getetag");
+const OUStringLiteral DAVProperties::GETLASTMODIFIED("DAV:getlastmodified");
+const OUStringLiteral DAVProperties::LOCKDISCOVERY("DAV:lockdiscovery");
+const OUStringLiteral DAVProperties::RESOURCETYPE("DAV:resourcetype");
+const OUStringLiteral DAVProperties::SOURCE("DAV:source");
+const OUStringLiteral DAVProperties::SUPPORTEDLOCK("DAV:supportedlock");
+const OUStringLiteral DAVProperties::EXECUTABLE("http://apache.org/dav/props/executable");
void DAVProperties::createNeonPropName( const OUString & rFullName,
NeonPropName & rName )
@@ -118,18 +117,18 @@ void DAVProperties::createUCBPropName( const char * nspace,
// Some servers send XML without proper namespaces. Assume "DAV:"
// in this case, if name is a well-known dav property name.
// Although this is not 100% correct, it solves many problems.
-
- if ( DAVProperties::RESOURCETYPE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::SUPPORTEDLOCK.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::LOCKDISCOVERY.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::CREATIONDATE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::DISPLAYNAME.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTLANGUAGE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTLENGTH.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETCONTENTTYPE.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETETAG.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::GETLASTMODIFIED.matchIgnoreAsciiCase( aName, 4 ) ||
- DAVProperties::SOURCE.matchIgnoreAsciiCase( aName, 4 ) )
+ if ( aName.equalsIgnoreAsciiCaseAscii(DAVProperties::RESOURCETYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::RESOURCETYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::SUPPORTEDLOCK.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::LOCKDISCOVERY.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::CREATIONDATE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::DISPLAYNAME.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTLANGUAGE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTLENGTH.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETCONTENTTYPE.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETETAG.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::GETLASTMODIFIED.data + 4) ||
+ aName.equalsIgnoreAsciiCaseAscii(DAVProperties::SOURCE.data + 4) )
aNameSpace = "DAV:";
}
diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.hxx b/ucb/source/ucp/webdav-neon/DAVProperties.hxx
index 2064a83b4726..06780e3dbf82 100644
--- a/ucb/source/ucp/webdav-neon/DAVProperties.hxx
+++ b/ucb/source/ucp/webdav-neon/DAVProperties.hxx
@@ -37,18 +37,18 @@ namespace webdav_ucp
struct DAVProperties
{
- static const OUString CREATIONDATE;
- static const OUString DISPLAYNAME;
- static const OUString GETCONTENTLANGUAGE;
- static const OUString GETCONTENTLENGTH;
- static const OUString GETCONTENTTYPE;
- static const OUString GETETAG;
- static const OUString GETLASTMODIFIED;
- static const OUString LOCKDISCOVERY;
- static const OUString RESOURCETYPE;
- static const OUString SOURCE;
- static const OUString SUPPORTEDLOCK;
- static const OUString EXECUTABLE;
+ static const OUStringLiteral CREATIONDATE;
+ static const OUStringLiteral DISPLAYNAME;
+ static const OUStringLiteral GETCONTENTLANGUAGE;
+ static const OUStringLiteral GETCONTENTLENGTH;
+ static const OUStringLiteral GETCONTENTTYPE;
+ static const OUStringLiteral GETETAG;
+ static const OUStringLiteral GETLASTMODIFIED;
+ static const OUStringLiteral LOCKDISCOVERY;
+ static const OUStringLiteral RESOURCETYPE;
+ static const OUStringLiteral SOURCE;
+ static const OUStringLiteral SUPPORTEDLOCK;
+ static const OUStringLiteral EXECUTABLE;
static void createNeonPropName( const OUString & rFullName,
NeonPropName & rName );