summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-12-13 17:05:55 +0200
committerTor Lillqvist <tml@collabora.com>2016-12-13 18:31:29 +0200
commitf409daff083903b066159c8e62f04bebd9263219 (patch)
treec202190e20696ed70222d64f9c9b635a9ff2ab5d /ucb
parent20cc8a453d3bc970ec4bfa899691027850bb8fe1 (diff)
loplugin:stringconstant
Change-Id: Ifc100e8ece6ea826b745919583beac315c41b100
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx6
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx53
-rw-r--r--ucb/source/ucp/webdav/webdavdatasupplier.cxx8
-rw-r--r--ucb/source/ucp/webdav/webdavprovider.cxx8
4 files changed, 29 insertions, 46 deletions
diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
index dff7b1fa6acf..ba82a417c91f 100644
--- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
@@ -176,11 +176,11 @@ static OUString encodeValue( const OUString & rValue )
const sal_Unicode c = pValue[ n ];
if ( '%' == c )
- aResult.appendAscii( "%per;" );
+ aResult.append( "%per;" );
else if ( '<' == c )
- aResult.appendAscii( "%lt;" );
+ aResult.append( "%lt;" );
else if ( '>' == c )
- aResult.appendAscii( "%gt;" );
+ aResult.append( "%gt;" );
else
aResult.append( c );
}
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 0575d4d321d5..60746e679a44 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -296,8 +296,7 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType )
uno::Reference< beans::XPropertySet > const xProps(
m_xContext, uno::UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xCtx;
- xCtx.set( xProps->getPropertyValue(
- OUString( "DefaultContext" ) ),
+ xCtx.set( xProps->getPropertyValue( "DefaultContext" ),
uno::UNO_QUERY_THROW );
uno::Reference< task::XInteractionHandler > xIH(
@@ -1120,8 +1119,7 @@ Content::queryCreatableContentsInfo()
| ucb::ContentInfoAttribute::KIND_DOCUMENT;
beans::Property aProp;
- m_pProvider->getProperty(
- OUString( "Title" ), aProp );
+ m_pProvider->getProperty( "Title", aProp );
uno::Sequence< beans::Property > aDocProps( 1 );
aDocProps.getArray()[ 0 ] = aProp;
@@ -1563,7 +1561,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
//xProps.reset(
// new ContentProperties( aUnescapedTitle ) );
xProps->addProperty(
- OUString( "Title" ),
+ "Title",
uno::makeAny( aUnescapedTitle ),
true );
}
@@ -1573,20 +1571,20 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
xProps.reset( new ContentProperties( aUnescapedTitle, false ) );
else
xProps->addProperty(
- OUString( "Title" ),
+ "Title",
uno::makeAny( aUnescapedTitle ),
true );
xProps->addProperty(
- OUString( "IsFolder" ),
+ "IsFolder",
uno::makeAny( false ),
true );
xProps->addProperty(
- OUString( "IsDocument" ),
+ "IsDocument",
uno::makeAny( true ),
true );
xProps->addProperty(
- OUString( "ContentType" ),
+ "ContentType",
uno::makeAny( OUString(WEBDAV_CONTENT_TYPE) ),
true );
}
@@ -1608,7 +1606,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
// Add BaseURI property, if requested.
xProps->addProperty(
- OUString( "BaseURI" ),
+ "BaseURI",
uno::makeAny( getBaseURI( xResAccess ) ),
true );
}
@@ -1616,11 +1614,10 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
// Add CreatableContentsInfo property, if requested.
bool bFolder = false;
- xProps->getValue(
- OUString( "IsFolder" ) )
+ xProps->getValue( "IsFolder" )
>>= bFolder;
xProps->addProperty(
- OUString( "CreatableContentsInfo" ),
+ "CreatableContentsInfo",
uno::makeAny( bFolder
? queryCreatableContentsInfo()
: uno::Sequence< ucb::ContentInfo >() ),
@@ -2086,8 +2083,7 @@ uno::Any Content::open(
// Error: Not a folder!
OUStringBuffer aMsg;
- aMsg.appendAscii( "Non-folder resource cannot be "
- "opened as folder! Wrong Open Mode!" );
+ aMsg.append( "Non-folder resource cannot be opened as folder! Wrong Open Mode!" );
ucbhelper::cancelCommandExecution(
uno::makeAny(
@@ -2637,23 +2633,19 @@ void Content::transfer(
OUString aScheme = sourceURI.GetScheme().toAsciiLowerCase();
if ( aScheme == WEBDAV_URL_SCHEME )
{
- sourceURI.SetScheme(
- OUString( HTTP_URL_SCHEME ) );
+ sourceURI.SetScheme( HTTP_URL_SCHEME );
}
else if ( aScheme == WEBDAVS_URL_SCHEME )
{
- sourceURI.SetScheme(
- OUString( HTTPS_URL_SCHEME ) );
+ sourceURI.SetScheme( HTTPS_URL_SCHEME );
}
else if ( aScheme == DAV_URL_SCHEME )
{
- sourceURI.SetScheme(
- OUString( HTTP_URL_SCHEME ) );
+ sourceURI.SetScheme( HTTP_URL_SCHEME );
}
else if ( aScheme == DAVS_URL_SCHEME )
{
- sourceURI.SetScheme(
- OUString( HTTPS_URL_SCHEME ) );
+ sourceURI.SetScheme( HTTPS_URL_SCHEME );
}
else
{
@@ -2671,17 +2663,13 @@ void Content::transfer(
aScheme = targetURI.GetScheme().toAsciiLowerCase();
if ( aScheme == WEBDAV_URL_SCHEME )
- targetURI.SetScheme(
- OUString( HTTP_URL_SCHEME ) );
+ targetURI.SetScheme( HTTP_URL_SCHEME );
else if ( aScheme == WEBDAVS_URL_SCHEME )
- targetURI.SetScheme(
- OUString( HTTPS_URL_SCHEME ) );
+ targetURI.SetScheme( HTTPS_URL_SCHEME );
else if ( aScheme == DAV_URL_SCHEME )
- targetURI.SetScheme(
- OUString( HTTP_URL_SCHEME ) );
+ targetURI.SetScheme( HTTP_URL_SCHEME );
else if ( aScheme == DAVS_URL_SCHEME )
- targetURI.SetScheme(
- OUString( HTTPS_URL_SCHEME ) );
+ targetURI.SetScheme( HTTPS_URL_SCHEME );
// @@@ This implementation of 'transfer' only works
// if the source and target are located at same host.
@@ -3286,8 +3274,7 @@ Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess )
if ( m_xCachedProps.get() )
{
OUString aLocation;
- m_xCachedProps->getValue( OUString(
- "Content-Location" ) ) >>= aLocation;
+ m_xCachedProps->getValue( "Content-Location" ) >>= aLocation;
if ( aLocation.getLength() )
{
try
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
index 05566de0e5ff..cfb8dd5c23f8 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
@@ -426,9 +426,7 @@ bool DataSupplier::getData()
bool bFolder = false;
const uno::Any & rValue
- = pContentProperties->getValue(
- OUString(
- "IsFolder" ) );
+ = pContentProperties->getValue( "IsFolder" );
rValue >>= bFolder;
if ( !bFolder )
@@ -442,9 +440,7 @@ bool DataSupplier::getData()
bool bDocument = false;
const uno::Any & rValue
- = pContentProperties->getValue(
- OUString(
- "IsDocument" ) );
+ = pContentProperties->getValue( "IsDocument" );
rValue >>= bDocument;
if ( !bDocument )
diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx
index d843a6a22018..0cca80f5bc95 100644
--- a/ucb/source/ucp/webdav/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav/webdavprovider.cxx
@@ -134,28 +134,28 @@ ContentProvider::queryContent(
{
aURL = aURL.replaceAt( 0,
WEBDAV_URL_SCHEME_LENGTH,
- OUString( HTTP_URL_SCHEME ) );
+ HTTP_URL_SCHEME );
bNewId = true;
}
else if ( aScheme == WEBDAVS_URL_SCHEME )
{
aURL = aURL.replaceAt( 0,
WEBDAVS_URL_SCHEME_LENGTH,
- OUString( HTTPS_URL_SCHEME ) );
+ HTTPS_URL_SCHEME );
bNewId = true;
}
else if ( aScheme == DAV_URL_SCHEME )
{
aURL = aURL.replaceAt( 0,
DAV_URL_SCHEME_LENGTH,
- OUString( HTTP_URL_SCHEME ) );
+ HTTP_URL_SCHEME );
bNewId = true;
}
else if ( aScheme == DAVS_URL_SCHEME )
{
aURL = aURL.replaceAt( 0,
DAVS_URL_SCHEME_LENGTH,
- OUString( HTTPS_URL_SCHEME ) );
+ HTTPS_URL_SCHEME );
bNewId = true;
}