summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-09-13 12:11:32 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:15:28 +0100
commitdca684d8f87e766c91de2dec0f9ac0d2822f4217 (patch)
tree9f1310b7326ba237aff128e9029f0829b0f34b1a
parent3afa1858a8a3d00ab6e03367f8cdf6cef2b511b2 (diff)
ucb: webdav-curl: fix [loplugin:*]
Change-Id: I357f8594a404eb17a0126359bdc5b2b4c6543de6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122045 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--ucb/source/ucp/webdav-curl/ContentProperties.cxx2
-rw-r--r--ucb/source/ucp/webdav-curl/DAVProperties.cxx63
-rw-r--r--ucb/source/ucp/webdav-curl/DAVProperties.hxx26
-rw-r--r--ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx4
-rw-r--r--ucb/source/ucp/webdav-curl/DAVResourceAccess.hxx2
-rw-r--r--ucb/source/ucp/webdav-curl/DAVSessionFactory.cxx2
-rw-r--r--ucb/source/ucp/webdav-curl/DateTimeHelper.cxx28
-rw-r--r--ucb/source/ucp/webdav-curl/DateTimeHelper.hxx2
-rw-r--r--ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx38
-rw-r--r--ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.hxx17
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx42
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.hxx4
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx4
-rw-r--r--ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx3
-rw-r--r--ucb/source/ucp/webdav-curl/webdavprovider.cxx9
-rw-r--r--ucb/source/ucp/webdav-curl/webdavprovider.hxx4
-rw-r--r--ucb/source/ucp/webdav-curl/webdavresponseparser.cxx12
17 files changed, 103 insertions, 159 deletions
diff --git a/ucb/source/ucp/webdav-curl/ContentProperties.cxx b/ucb/source/ucp/webdav-curl/ContentProperties.cxx
index 85406e680972..c3d663434869 100644
--- a/ucb/source/ucp/webdav-curl/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav-curl/ContentProperties.cxx
@@ -141,7 +141,7 @@ ContentProperties::ContentProperties()
ContentProperties::ContentProperties( const ContentProperties & rOther )
: m_aEscapedTitle( rOther.m_aEscapedTitle ),
- m_xProps( rOther.m_xProps.get()
+ m_xProps( rOther.m_xProps
? new PropertyValueMap( *rOther.m_xProps )
: new PropertyValueMap ),
m_bTrailingSlash( rOther.m_bTrailingSlash )
diff --git a/ucb/source/ucp/webdav-curl/DAVProperties.cxx b/ucb/source/ucp/webdav-curl/DAVProperties.cxx
index a08a8488da15..746c82ad993d 100644
--- a/ucb/source/ucp/webdav-curl/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVProperties.cxx
@@ -17,70 +17,47 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <string.h>
#include "DAVProperties.hxx"
#include <rtl/ustrbuf.hxx>
+#include <o3tl/string_view.hxx>
+#include <string.h>
using namespace http_dav_ucp;
-const OUString DAVProperties::CREATIONDATE =
- OUString( "DAV:creationdate" );
-const OUString DAVProperties::DISPLAYNAME =
- OUString( "DAV:displayname" );
-const OUString DAVProperties::GETCONTENTLANGUAGE =
- OUString( "DAV:getcontentlanguage" );
-const OUString DAVProperties::GETCONTENTLENGTH =
- OUString( "DAV:getcontentlength" );
-const OUString DAVProperties::GETCONTENTTYPE =
- OUString( "DAV:getcontenttype" );
-const OUString DAVProperties::GETETAG =
- OUString( "DAV:getetag" );
-const OUString DAVProperties::GETLASTMODIFIED =
- OUString( "DAV:getlastmodified" );
-const OUString DAVProperties::LOCKDISCOVERY =
- OUString( "DAV:lockdiscovery" );
-const OUString DAVProperties::RESOURCETYPE =
- OUString( "DAV:resourcetype" );
-const OUString DAVProperties::SUPPORTEDLOCK =
- OUString( "DAV:supportedlock" );
-
-const OUString DAVProperties::EXECUTABLE =
- OUString( "http://apache.org/dav/props/executable" );
-
// static
-void DAVProperties::createSerfPropName( const OUString & rFullName,
+void DAVProperties::createSerfPropName( ::std::u16string_view const rFullName,
SerfPropName & rName )
{
- if ( rFullName.startsWith( "DAV:" ) )
+ if (o3tl::starts_with(rFullName, u"DAV:"))
{
rName.nspace = "DAV:";
rName.name
= strdup( OUStringToOString(
- rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ),
+ rFullName.substr(RTL_CONSTASCII_LENGTH("DAV:")),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
+ else if (o3tl::starts_with(rFullName, u"http://apache.org/dav/props/"))
{
rName.nspace = "http://apache.org/dav/props/";
rName.name
= strdup( OUStringToOString(
- rFullName.copy(
+ rFullName.substr(
RTL_CONSTASCII_LENGTH(
"http://apache.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
+ else if (o3tl::starts_with(rFullName, u"http://ucb.openoffice.org/dav/props/"))
{
rName.nspace = "http://ucb.openoffice.org/dav/props/";
rName.name
= strdup( OUStringToOString(
- rFullName.copy(
+ rFullName.substr(
RTL_CONSTASCII_LENGTH(
"http://ucb.openoffice.org/dav/props/" ) ),
RTL_TEXTENCODING_UTF8 ).getStr() );
}
- else if ( rFullName.startsWith( "<prop:" ) )
+ else if (o3tl::starts_with(rFullName, u"<prop:"))
{
// Support for 3rd party namespaces/props
@@ -124,16 +101,16 @@ void DAVProperties::createUCBPropName( const char * nspace,
// 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 ) )
+ if (o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::RESOURCETYPE).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::SUPPORTEDLOCK).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::LOCKDISCOVERY).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::CREATIONDATE).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::DISPLAYNAME).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::GETCONTENTLANGUAGE).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::GETCONTENTLENGTH).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::GETCONTENTTYPE).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::GETETAG).substr(4)) ||
+ o3tl::equalsIgnoreAsciiCase(aName, std::u16string_view(DAVProperties::GETLASTMODIFIED).substr(4)))
{
aNameSpace = "DAV:";
}
diff --git a/ucb/source/ucp/webdav-curl/DAVProperties.hxx b/ucb/source/ucp/webdav-curl/DAVProperties.hxx
index 5bc9a1b0c8f4..af005300c79d 100644
--- a/ucb/source/ucp/webdav-curl/DAVProperties.hxx
+++ b/ucb/source/ucp/webdav-curl/DAVProperties.hxx
@@ -29,19 +29,19 @@ typedef struct { const char *nspace, *name; } SerfPropName;
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 SUPPORTEDLOCK;
- static const OUString EXECUTABLE;
-
- static void createSerfPropName( const OUString & rFullName,
+ static constexpr OUStringLiteral CREATIONDATE = u"DAV:creationdate";
+ static constexpr OUStringLiteral DISPLAYNAME = u"DAV:displayname";
+ static constexpr OUStringLiteral GETCONTENTLANGUAGE = u"DAV:getcontentlanguage";
+ static constexpr OUStringLiteral GETCONTENTLENGTH = u"DAV:getcontentlength";
+ static constexpr OUStringLiteral GETCONTENTTYPE = u"DAV:getcontenttype";
+ static constexpr OUStringLiteral GETETAG = u"DAV:getetag";
+ static constexpr OUStringLiteral GETLASTMODIFIED = u"DAV:getlastmodified";
+ static constexpr OUStringLiteral LOCKDISCOVERY = u"DAV:lockdiscovery";
+ static constexpr OUStringLiteral RESOURCETYPE = u"DAV:resourcetype";
+ static constexpr OUStringLiteral SUPPORTEDLOCK = u"DAV:supportedlock";
+ static constexpr OUStringLiteral EXECUTABLE = u"http://apache.org/dav/props/executable";
+
+ static void createSerfPropName( ::std::u16string_view rFullName,
SerfPropName & rName );
static void createUCBPropName ( const char * nspace,
const char * name,
diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
index 90001a818645..2019f198e61b 100644
--- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.cxx
@@ -70,7 +70,7 @@ int DAVAuthListener_Impl::authenticate(
outPassWord,
true /*bAllowPersistentStoring*/,
bCanUseSystemCredentials );
- xIH->handle( xRequest.get() );
+ xIH->handle( xRequest );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
= xRequest->getSelection();
@@ -1053,7 +1053,7 @@ void DAVResourceAccess::getUserRequestHeaders(
bool DAVResourceAccess::detectRedirectCycle(
- const OUString& rRedirectURL )
+ ::std::u16string_view const rRedirectURL)
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav-curl/DAVResourceAccess.hxx b/ucb/source/ucp/webdav-curl/DAVResourceAccess.hxx
index b5c521fb414e..429ac08897d3 100644
--- a/ucb/source/ucp/webdav-curl/DAVResourceAccess.hxx
+++ b/ucb/source/ucp/webdav-curl/DAVResourceAccess.hxx
@@ -195,7 +195,7 @@ public:
private:
const OUString & getRequestURI() const;
/// @throws DAVException
- bool detectRedirectCycle( const OUString& rRedirectURL );
+ bool detectRedirectCycle(::std::u16string_view rRedirectURL);
/// @throws DAVException
bool handleException( DAVException & e, int errorCount );
/// @throws DAVException
diff --git a/ucb/source/ucp/webdav-curl/DAVSessionFactory.cxx b/ucb/source/ucp/webdav-curl/DAVSessionFactory.cxx
index 6a0963f915d2..ee509f292cf5 100644
--- a/ucb/source/ucp/webdav-curl/DAVSessionFactory.cxx
+++ b/ucb/source/ucp/webdav-curl/DAVSessionFactory.cxx
@@ -35,7 +35,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
{
osl::MutexGuard aGuard( m_aMutex );
- if ( !m_xProxyDecider.get() )
+ if (!m_xProxyDecider)
m_xProxyDecider.reset( new ucbhelper::InternetProxyDecider( rxContext ) );
Map::iterator aIt = std::find_if(m_aMap.begin(), m_aMap.end(),
diff --git a/ucb/source/ucp/webdav-curl/DateTimeHelper.cxx b/ucb/source/ucp/webdav-curl/DateTimeHelper.cxx
index dfa21ed5670f..06514d682fa6 100644
--- a/ucb/source/ucp/webdav-curl/DateTimeHelper.cxx
+++ b/ucb/source/ucp/webdav-curl/DateTimeHelper.cxx
@@ -96,7 +96,7 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s,
dateTime.Seconds = aDateTime.Seconds;
return true;
- }
+ }
}
}
@@ -125,31 +125,31 @@ sal_Int32 DateTimeHelper::convertDayToInt (const OUString& day)
}
*/
-sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month)
+sal_Int32 DateTimeHelper::convertMonthToInt(std::u16string_view month)
{
- if (month == "Jan")
+ if (month == u"Jan")
return 1;
- else if (month == "Feb")
+ else if (month == u"Feb")
return 2;
- else if (month == "Mar")
+ else if (month == u"Mar")
return 3;
- else if (month == "Apr")
+ else if (month == u"Apr")
return 4;
- else if (month == "May")
+ else if (month == u"May")
return 5;
- else if (month == "Jun")
+ else if (month == u"Jun")
return 6;
- else if (month == "Jul")
+ else if (month == u"Jul")
return 7;
- else if (month == "Aug")
+ else if (month == u"Aug")
return 8;
- else if (month == "Sep")
+ else if (month == u"Sep")
return 9;
- else if (month == "Oct")
+ else if (month == u"Oct")
return 10;
- else if (month == "Nov")
+ else if (month == u"Nov")
return 11;
- else if (month == "Dec")
+ else if (month == u"Dec")
return 12;
else
return 0;
diff --git a/ucb/source/ucp/webdav-curl/DateTimeHelper.hxx b/ucb/source/ucp/webdav-curl/DateTimeHelper.hxx
index 0ff880fa8525..22a8e9519b80 100644
--- a/ucb/source/ucp/webdav-curl/DateTimeHelper.hxx
+++ b/ucb/source/ucp/webdav-curl/DateTimeHelper.hxx
@@ -37,7 +37,7 @@ namespace http_dav_ucp
class DateTimeHelper
{
private:
- static sal_Int32 convertMonthToInt (const OUString& );
+ static sal_Int32 convertMonthToInt(std::u16string_view month);
static bool ISO8601_To_DateTime (const OUString&,
css::util::DateTime& );
diff --git a/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx
index 0f3543012ce7..0b3fc082136f 100644
--- a/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.cxx
@@ -26,32 +26,20 @@ using namespace ::com::sun::star;
// static
-const OUString UCBDeadPropertyValue::aTypeString
- = "string";
-const OUString UCBDeadPropertyValue::aTypeLong
- = "long";
-const OUString UCBDeadPropertyValue::aTypeShort
- = "short";
-const OUString UCBDeadPropertyValue::aTypeBoolean
- = "boolean";
-const OUString UCBDeadPropertyValue::aTypeChar
- = "char";
-const OUString UCBDeadPropertyValue::aTypeByte
- = "byte";
-const OUString UCBDeadPropertyValue::aTypeHyper
- = "hyper";
-const OUString UCBDeadPropertyValue::aTypeFloat
- = "float";
-const OUString UCBDeadPropertyValue::aTypeDouble
- = "double";
+constexpr OUStringLiteral aTypeString = u"string";
+constexpr OUStringLiteral aTypeLong = u"long";
+constexpr OUStringLiteral aTypeShort = u"short";
+constexpr OUStringLiteral aTypeBoolean = u"boolean";
+constexpr OUStringLiteral aTypeChar = u"char";
+constexpr OUStringLiteral aTypeByte = u"byte";
+constexpr OUStringLiteral aTypeHyper = u"hyper";
+constexpr OUStringLiteral aTypeFloat = u"float";
+constexpr OUStringLiteral aTypeDouble = u"double";
// static
-const OUString UCBDeadPropertyValue::aXMLPre
- = "<ucbprop><type>";
-const OUString UCBDeadPropertyValue::aXMLMid
- = "</type><value>";
-const OUString UCBDeadPropertyValue::aXMLEnd
- = "</value></ucbprop>";
+constexpr OUStringLiteral aXMLPre = u"<ucbprop><type>";
+constexpr OUStringLiteral aXMLMid = u"</type><value>";
+constexpr OUStringLiteral aXMLEnd = u"</value></ucbprop>";
/*
@@ -337,7 +325,7 @@ bool UCBDeadPropertyValue::supportsType( const uno::Type & rType )
// static
-bool UCBDeadPropertyValue::createFromXML( const OString & /*rInData*/,
+bool UCBDeadPropertyValue::createFromXML( std::u16string_view /*rInData*/,
uno::Any & /*rOutData*/ )
{
bool success = false;
diff --git a/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.hxx b/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.hxx
index 0c9c0d19bca8..c54d65c69573 100644
--- a/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.hxx
+++ b/ucb/source/ucp/webdav-curl/UCBDeadPropertyValue.hxx
@@ -28,25 +28,10 @@ namespace http_dav_ucp
class UCBDeadPropertyValue
{
-private:
- static const OUString aTypeString;
- static const OUString aTypeLong;
- static const OUString aTypeShort;
- static const OUString aTypeBoolean;
- static const OUString aTypeChar;
- static const OUString aTypeByte;
- static const OUString aTypeHyper;
- static const OUString aTypeFloat;
- static const OUString aTypeDouble;
-
- static const OUString aXMLPre;
- static const OUString aXMLMid;
- static const OUString aXMLEnd;
-
public:
static bool supportsType( const css::uno::Type & rType );
- static bool createFromXML( const OString & rInData,
+ static bool createFromXML( std::u16string_view rInData,
css::uno::Any & rOutData );
static bool toXML( const css::uno::Any & rInData,
OUString & rOutData );
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 4cf298bdf471..5d06a3192944 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -171,7 +171,7 @@ void lcl_sendPartialGETRequest( bool &bError,
}
}
- if ( xProps.get() )
+ if (xProps)
xProps->addProperties(
rProps,
ContentProperties( aResource ) );
@@ -261,16 +261,14 @@ Content::~Content()
// virtual
-void SAL_CALL Content::acquire()
- throw( )
+void SAL_CALL Content::acquire() noexcept
{
ContentImplHelper::acquire();
}
// virtual
-void SAL_CALL Content::release()
- throw( )
+void SAL_CALL Content::release() noexcept
{
ContentImplHelper::release();
}
@@ -1232,7 +1230,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
xRow->appendPropertySet( xSet );
}
- return uno::Reference< sdbc::XRow >( xRow.get() );
+ return uno::Reference<sdbc::XRow>(xRow);
}
@@ -1255,11 +1253,11 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
aUnescapedTitle = SerfUri::unescape( m_aEscapedTitle );
xContext.set( m_xContext );
xIdentifier.set( m_xIdentifier );
- xProvider.set( m_xProvider.get() );
+ xProvider = m_xProvider;
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
// First, ask cache...
- if ( m_xCachedProps.get() )
+ if (m_xCachedProps)
{
xCachedProps.reset( new ContentProperties( *m_xCachedProps ) );
@@ -1288,7 +1286,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
// cache lookup... getResourceType may fill the props cache via
// PROPFIND!
- if ( m_xCachedProps.get() )
+ if (m_xCachedProps)
{
xCachedProps.reset(
new ContentProperties( *m_xCachedProps ) );
@@ -1351,7 +1349,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
if ( 1 == resources.size() )
{
- if ( xProps.get())
+ if (xProps)
xProps->addProperties(
aPropNames,
ContentProperties( resources[ 0 ] ));
@@ -1379,7 +1377,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
// All properties obtained already?
std::vector< OUString > aMissingProps;
- if ( !( xProps.get()
+ if ( !( xProps
&& xProps->containsAllNames(
rProperties, aMissingProps ) )
|| !m_bDidGetOrHead )
@@ -1401,7 +1399,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
xResAccess->HEAD( aHeaderNames, resource, xEnv );
m_bDidGetOrHead = true;
- if ( xProps.get() )
+ if (xProps)
xProps->addProperties(
aMissingProps,
ContentProperties( resource ) );
@@ -1482,7 +1480,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
}
else
{
- if ( !xProps.get() )
+ if (!xProps)
xProps.reset( new ContentProperties( aUnescapedTitle, false ) );
else
xProps->addProperty(
@@ -1550,7 +1548,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
- if ( !m_xCachedProps.get() )
+ if (!m_xCachedProps)
m_xCachedProps.reset( new CachableContentProperties( *xProps ) );
else
m_xCachedProps->addProperties( *xProps );
@@ -1988,12 +1986,10 @@ uno::Any Content::open(
{
// Error: Not a folder!
- OUString aMsg( "Non-folder resource cannot be opened as folder! Wrong Open Mode!" );
-
ucbhelper::cancelCommandExecution(
uno::makeAny(
lang::IllegalArgumentException(
- aMsg,
+ "Non-folder resource cannot be opened as folder! Wrong Open Mode!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
xEnv );
@@ -2044,7 +2040,7 @@ uno::Any Content::open(
osl::MutexGuard aGuard( m_aMutex );
// cache headers.
- if ( !m_xCachedProps.get())
+ if (!m_xCachedProps)
m_xCachedProps.reset(
new CachableContentProperties( ContentProperties( aResource ) ) );
else
@@ -2088,7 +2084,7 @@ uno::Any Content::open(
osl::MutexGuard aGuard( m_aMutex );
// cache headers.
- if ( !m_xCachedProps.get())
+ if (!m_xCachedProps)
m_xCachedProps.reset(
new CachableContentProperties( ContentProperties( aResource ) ) );
else
@@ -2332,7 +2328,7 @@ void Content::insert(
aExAsAny,
ContinuationFlags::Approve
| ContinuationFlags::Disapprove );
- xIH->handle( xRequest.get() );
+ xIH->handle( xRequest );
const ContinuationFlags nResp = xRequest->getResponse();
@@ -2515,7 +2511,7 @@ void Content::transfer(
xContext.set( m_xContext );
xIdentifier.set( m_xIdentifier );
- xProvider.set( m_xProvider.get() );
+ xProvider.set( m_xProvider );
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
}
@@ -2780,7 +2776,7 @@ bool Content::supportsExclusiveWriteLock(
{
if ( getResourceType( Environment ) == DAV )
{
- if ( m_xCachedProps.get() )
+ if (m_xCachedProps)
{
uno::Sequence< ucb::LockEntry > aSupportedLocks;
if ( m_xCachedProps->getValue( DAVProperties::SUPPORTEDLOCK )
@@ -3167,7 +3163,7 @@ Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess )
osl::Guard< osl::Mutex > aGuard( m_aMutex );
// First, try to obtain value of response header "Content-Location".
- if ( m_xCachedProps.get() )
+ if (m_xCachedProps)
{
OUString aLocation;
m_xCachedProps->getValue( "Content-Location" ) >>= aLocation;
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.hxx b/ucb/source/ucp/webdav-curl/webdavcontent.hxx
index 8ecb5577cc54..5aabca16522f 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.hxx
@@ -200,9 +200,9 @@ public:
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire()
- throw() override;
+ noexcept override;
virtual void SAL_CALL release()
- throw() override;
+ noexcept override;
// XTypeProvider
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
diff --git a/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx
index 14050e2a1e49..3feaf4ce694e 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx
@@ -276,7 +276,7 @@ uno::Sequence< beans::Property > Content::getProperties(
bTransient = m_bTransient;
xResAccess.reset( new DAVResourceAccess( *m_xResAccess ) );
- if ( m_xCachedProps.get() )
+ if (m_xCachedProps)
xCachedProps.reset(
new ContentProperties( *m_xCachedProps ) );
xProvider.set( m_pProvider );
@@ -438,7 +438,7 @@ uno::Sequence< beans::Property > Content::getProperties(
"CreatableContentsInfo" ) );
// Add cached properties, if present and still missing.
- if ( xCachedProps.get() )
+ if (xCachedProps)
{
const std::unique_ptr< PropertyValueMap > & xProps
= xCachedProps->getProperties();
diff --git a/ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx
index 8be3a0d401d2..75819bcd3f92 100644
--- a/ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx
@@ -291,8 +291,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues(
m_pImpl->m_xContext,
getResultSet()->getProperties(),
*(m_pImpl->m_aResults[ nIndex ]->pData),
- rtl::Reference< ::ucbhelper::ContentProviderImplHelper >(
- m_pImpl->m_xContent->getProvider().get() ),
+ m_pImpl->m_xContent->getProvider(),
queryContentIdentifierString( nIndex ) );
m_pImpl->m_aResults[ nIndex ]->xRow = xRow;
return xRow;
diff --git a/ucb/source/ucp/webdav-curl/webdavprovider.cxx b/ucb/source/ucp/webdav-curl/webdavprovider.cxx
index cc19bc7f0a61..effd6665ad1d 100644
--- a/ucb/source/ucp/webdav-curl/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavprovider.cxx
@@ -50,14 +50,12 @@ ContentProvider::~ContentProvider()
// XInterface methods.
-void SAL_CALL ContentProvider::acquire()
- throw()
+void SAL_CALL ContentProvider::acquire() noexcept
{
OWeakObject::acquire();
}
-void SAL_CALL ContentProvider::release()
- throw()
+void SAL_CALL ContentProvider::release() noexcept
{
OWeakObject::release();
}
@@ -143,8 +141,7 @@ ContentProvider::queryContent(
osl::MutexGuard aGuard( m_aMutex );
// Check, if a content with given id already exists...
- uno::Reference< ucb::XContent > xContent
- = queryExistingContent( xCanonicId ).get();
+ uno::Reference<ucb::XContent> xContent = queryExistingContent(xCanonicId);
if ( xContent.is() )
return xContent;
diff --git a/ucb/source/ucp/webdav-curl/webdavprovider.hxx b/ucb/source/ucp/webdav-curl/webdavprovider.hxx
index ff6e9af34ca4..d1ed65061717 100644
--- a/ucb/source/ucp/webdav-curl/webdavprovider.hxx
+++ b/ucb/source/ucp/webdav-curl/webdavprovider.hxx
@@ -71,9 +71,9 @@ public:
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire()
- throw() override;
+ noexcept override;
virtual void SAL_CALL release()
- throw() override;
+ noexcept override;
// XTypeProvider
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
diff --git a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
index 2a26c289951e..d95ff1416160 100644
--- a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/ucb/Lock.hpp>
#include <map>
#include <unordered_map>
+#include <rtl/ref.hxx>
#include <sal/log.hxx>
using namespace com::sun::star;
@@ -46,13 +47,13 @@ namespace
WebDAVNamespace_last
};
- WebDAVNamespace StrToWebDAVNamespace(const OUString& rStr)
+ WebDAVNamespace StrToWebDAVNamespace(::std::u16string_view rStr)
{
- if(rStr == "DAV:")
+ if (rStr == u"DAV:")
{
return WebDAVNamespace_DAV;
}
- else if(rStr == "http://ucb.openoffice.org/dav/props/")
+ else if (rStr == u"http://ucb.openoffice.org/dav/props/")
{
return WebDAVNamespace_ucb_openoffice_org_dav_props;
}
@@ -849,7 +850,8 @@ namespace
comphelper::getProcessComponentContext() );
// create parser; connect parser and filter
- WebDAVResponseParser* pWebDAVResponseParser = new WebDAVResponseParser(eWebDAVResponseParserMode);
+ rtl::Reference<WebDAVResponseParser> const pWebDAVResponseParser(
+ new WebDAVResponseParser(eWebDAVResponseParserMode));
uno::Reference< xml::sax::XDocumentHandler > xWebDAVHdl(pWebDAVResponseParser);
xParser->setDocumentHandler(xWebDAVHdl);
@@ -857,7 +859,7 @@ namespace
xParser->parseStream(myInputSource);
// get result
- rResult = (pWebDAVResponseParser->*fn)();
+ rResult = (pWebDAVResponseParser.get()->*fn)();
}
catch(uno::Exception&)
{