summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-27 20:21:15 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-27 20:22:03 +0200
commit6671fa81db0ecea4ada005bb79f55f08fb440ad4 (patch)
tree85ad806ece8d60736b6b01310b04b053dc2f8179 /ucb
parentb6d8251eee90b7e24ebb3f8452eff36a507e6d91 (diff)
Removed uses of rtl::O[U]String[Buffer]::operator sal_{char|Unicode} const *().
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/gvfs/gvfs_content.cxx23
-rw-r--r--ucb/source/ucp/webdav/DAVProperties.cxx12
-rw-r--r--ucb/source/ucp/webdav/NeonHeadRequest.cxx2
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx40
-rw-r--r--ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx4
5 files changed, 40 insertions, 41 deletions
diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx
index 45ef143e64ca..2966cfe8ab76 100644
--- a/ucb/source/ucp/gvfs/gvfs_content.cxx
+++ b/ucb/source/ucp/gvfs/gvfs_content.cxx
@@ -104,7 +104,7 @@ static char *
OUStringToGnome( const rtl::OUString &str )
{
rtl::OString aTempStr = rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 );
- return g_strdup( (const sal_Char *) aTempStr );
+ return g_strdup( aTempStr.getStr() );
}
static rtl::OUString
@@ -409,7 +409,7 @@ uno::Any SAL_CALL Content::execute(
aCommand.Argument >>= bDeletePhysical;
::rtl::OString aURI = getOURI();
- GnomeVFSResult result = gnome_vfs_unlink ((const sal_Char *) aURI);
+ GnomeVFSResult result = gnome_vfs_unlink (aURI.getStr());
if (result != GNOME_VFS_OK)
cancelCommandExecution( result, xEnv, sal_True );
@@ -640,7 +640,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
::rtl::OString aURI = getOURI();
gnome_vfs_get_file_info
- ( (const sal_Char *)aURI, fileInfo,
+ ( aURI.getStr(), fileInfo,
GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS );
if (fileInfo->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_ACCESS) {
@@ -741,7 +741,7 @@ Content::doSetFileInfo( const GnomeVFSFileInfo *newInfo,
// The simple approach:
if( setMask != GNOME_VFS_SET_FILE_INFO_NONE )
result = gnome_vfs_set_file_info // missed a const in the API there
- ( (const sal_Char *) aURI, (GnomeVFSFileInfo *)newInfo, setMask );
+ ( aURI.getStr(), (GnomeVFSFileInfo *)newInfo, setMask );
if ( result == GNOME_VFS_ERROR_NOT_SUPPORTED &&
( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) ) {
@@ -752,7 +752,7 @@ Content::doSetFileInfo( const GnomeVFSFileInfo *newInfo,
char *newURI = OUStringToGnome( makeNewURL( newInfo->name ) );
- result = gnome_vfs_move ((const sal_Char *)aURI, newURI, FALSE);
+ result = gnome_vfs_move (aURI.getStr(), newURI, FALSE);
g_free (newURI);
}
@@ -964,7 +964,7 @@ void Content::insert(
#ifdef DEBUG
g_warning ("Make directory");
#endif
- result = gnome_vfs_make_directory( (const sal_Char *) aURI, perm );
+ result = gnome_vfs_make_directory( aURI.getStr(), perm );
if( result != GNOME_VFS_OK )
cancelCommandExecution( result, xEnv, sal_True );
@@ -988,8 +988,7 @@ void Content::insert(
result = GNOME_VFS_OK;
if ( bReplaceExisting ) {
Authentication aAuth( xEnv );
- result = gnome_vfs_open( &handle, (const sal_Char *)aURI,
- GNOME_VFS_OPEN_WRITE );
+ result = gnome_vfs_open( &handle, aURI.getStr(), GNOME_VFS_OPEN_WRITE );
}
if ( result != GNOME_VFS_OK ) {
@@ -1000,7 +999,7 @@ void Content::insert(
( GNOME_VFS_PERM_GROUP_WRITE | GNOME_VFS_PERM_GROUP_READ ) );
result = gnome_vfs_create
- ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_WRITE, TRUE, perm );
+ ( &handle, aURI.getStr(), GNOME_VFS_OPEN_WRITE, TRUE, perm );
}
if( result != GNOME_VFS_OK )
@@ -1140,7 +1139,7 @@ Content::getInfo( const uno::Reference< ucb::XCommandEnvironment >& xEnv )
::rtl::OString aURI = getOURI();
Authentication aAuth( xEnv );
result = gnome_vfs_get_file_info
- ( (const sal_Char *)aURI, &m_info, GNOME_VFS_FILE_INFO_DEFAULT );
+ ( aURI.getStr(), &m_info, GNOME_VFS_FILE_INFO_DEFAULT );
if (result != GNOME_VFS_OK)
gnome_vfs_file_info_clear( &m_info );
} else
@@ -1459,7 +1458,7 @@ Content::createTempStream(
cancelCommandExecution( GNOME_VFS_ERROR_IO, xEnv );
result = gnome_vfs_open
- ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_READ );
+ ( &handle, aURI.getStr(), GNOME_VFS_OPEN_READ );
if (result != GNOME_VFS_OK)
cancelCommandExecution( result, xEnv );
@@ -1488,7 +1487,7 @@ Content::createInputStream(
return createTempStream( xEnv );
result = gnome_vfs_open
- ( &handle, (const sal_Char *)aURI,
+ ( &handle, aURI.getStr(),
(GnomeVFSOpenMode) (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_RANDOM ) );
if (result == GNOME_VFS_ERROR_INVALID_OPEN_MODE ||
diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx
index 0562ef0b91e1..5c4fec10364d 100644
--- a/ucb/source/ucp/webdav/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav/DAVProperties.cxx
@@ -59,7 +59,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rName.name
= strdup( rtl::OUStringToOString(
rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ),
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
}
else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
"http://apache.org/dav/props/" ) ) == 0 )
@@ -70,7 +70,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rFullName.copy(
RTL_CONSTASCII_LENGTH(
"http://apache.org/dav/props/" ) ),
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
}
else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
"http://ucb.openoffice.org/dav/props/" ) ) == 0 )
@@ -81,7 +81,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rFullName.copy(
RTL_CONSTASCII_LENGTH(
"http://ucb.openoffice.org/dav/props/" ) ),
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
}
else if ( rFullName.compareToAscii( RTL_CONSTASCII_STRINGPARAM(
"<prop:" ) ) == 0 )
@@ -95,11 +95,11 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
sal_Int32 nStart = RTL_CONSTASCII_LENGTH( "<prop:" );
sal_Int32 nLen = aFullName.indexOf( ' ' ) - nStart;
- rName.name = strdup( aFullName.copy( nStart, nLen ) );
+ rName.name = strdup( aFullName.copy( nStart, nLen ).getStr() );
nStart = aFullName.indexOf( '=', nStart + nLen ) + 2; // after ="
nLen = aFullName.getLength() - RTL_CONSTASCII_LENGTH( "\">" ) - nStart;
- rName.nspace = strdup( aFullName.copy( nStart, nLen ) );
+ rName.nspace = strdup( aFullName.copy( nStart, nLen ).getStr() );
}
else
{
@@ -107,7 +107,7 @@ void DAVProperties::createNeonPropName( const rtl::OUString & rFullName,
rName.nspace = "http://ucb.openoffice.org/dav/props/";
rName.name
= strdup( rtl::OUStringToOString( rFullName,
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index d33ff2a517cf..71ea451a4847 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -111,7 +111,7 @@ NeonHeadRequest::NeonHeadRequest( HttpSession * inSession,
"HEAD",
rtl::OUStringToOString(
inPath,
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
{
osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex );
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index de7f69c29358..107ca9c3dd92 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -344,10 +344,10 @@ extern "C" int NeonSession_NeonAuth( void * inUserData,
}
strcpy( inoutUserName, // #100211# - checked
- rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ).getStr() );
strcpy( inoutPassWord, // #100211# - checked
- rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
+ rtl::OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ).getStr() );
return theRetVal;
}
@@ -868,7 +868,7 @@ void NeonSession::OPTIONS( const rtl::OUString & inPath,
int theRetVal = ne_options( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
&servercaps );
HandleError( theRetVal, inPath, rEnv );
@@ -895,7 +895,7 @@ void NeonSession::PROPFIND( const rtl::OUString & inPath,
int theRetVal = NE_OK;
NeonPropFindRequest theRequest( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
inDepth,
inPropNames,
ioResources,
@@ -920,7 +920,7 @@ void NeonSession::PROPFIND( const rtl::OUString & inPath,
int theRetVal = NE_OK;
NeonPropFindRequest theRequest( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
inDepth,
ioResInfo,
theRetVal );
@@ -1024,7 +1024,7 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath,
}
pItems[ n ].value
= strdup( rtl::OUStringToOString( aStringValue,
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
}
else
{
@@ -1043,7 +1043,7 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath,
theRetVal = ne_proppatch( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
pItems );
}
@@ -1098,7 +1098,7 @@ NeonSession::GET( const rtl::OUString & inPath,
NeonRequestContext aCtx( xInputStream );
int theRetVal = GET( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
NeonSession_ResponseBlockReader,
false,
&aCtx );
@@ -1123,7 +1123,7 @@ void NeonSession::GET( const rtl::OUString & inPath,
NeonRequestContext aCtx( ioOutputStream );
int theRetVal = GET( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
NeonSession_ResponseBlockWriter,
false,
&aCtx );
@@ -1152,7 +1152,7 @@ NeonSession::GET( const rtl::OUString & inPath,
NeonRequestContext aCtx( xInputStream, inHeaderNames, ioResource );
int theRetVal = GET( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
NeonSession_ResponseBlockReader,
true,
&aCtx );
@@ -1182,7 +1182,7 @@ void NeonSession::GET( const rtl::OUString & inPath,
NeonRequestContext aCtx( ioOutputStream, inHeaderNames, ioResource );
int theRetVal = GET( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
NeonSession_ResponseBlockWriter,
true,
&aCtx );
@@ -1208,7 +1208,7 @@ void NeonSession::PUT( const rtl::OUString & inPath,
int theRetVal = PUT( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
reinterpret_cast< const char * >(
aDataToSend.getConstArray() ),
aDataToSend.getLength() );
@@ -1239,7 +1239,7 @@ NeonSession::POST( const rtl::OUString & inPath,
NeonRequestContext aCtx( xInputStream );
int theRetVal = POST( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
reinterpret_cast< const char * >(
aDataToSend.getConstArray() ),
NeonSession_ResponseBlockReader,
@@ -1274,7 +1274,7 @@ void NeonSession::POST( const rtl::OUString & inPath,
NeonRequestContext aCtx( oOutputStream );
int theRetVal = POST( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ),
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
reinterpret_cast< const char * >(
aDataToSend.getConstArray() ),
NeonSession_ResponseBlockWriter,
@@ -1298,7 +1298,7 @@ void NeonSession::MKCOL( const rtl::OUString & inPath,
int theRetVal = ne_mkcol( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ) );
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr() );
HandleError( theRetVal, inPath, rEnv );
}
@@ -1324,10 +1324,10 @@ void NeonSession::COPY( const rtl::OUString & inSourceURL,
NE_DEPTH_INFINITE,
rtl::OUStringToOString(
theSourceUri.GetPath(),
- RTL_TEXTENCODING_UTF8 ),
+ RTL_TEXTENCODING_UTF8 ).getStr(),
rtl::OUStringToOString(
theDestinationUri.GetPath(),
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
HandleError( theRetVal, inSourceURL, rEnv );
}
@@ -1351,10 +1351,10 @@ void NeonSession::MOVE( const rtl::OUString & inSourceURL,
inOverWrite ? 1 : 0,
rtl::OUStringToOString(
theSourceUri.GetPath(),
- RTL_TEXTENCODING_UTF8 ),
+ RTL_TEXTENCODING_UTF8 ).getStr(),
rtl::OUStringToOString(
theDestinationUri.GetPath(),
- RTL_TEXTENCODING_UTF8 ) );
+ RTL_TEXTENCODING_UTF8 ).getStr() );
HandleError( theRetVal, inSourceURL, rEnv );
}
@@ -1372,7 +1372,7 @@ void NeonSession::DESTROY( const rtl::OUString & inPath,
int theRetVal = ne_delete( m_pHttpSession,
rtl::OUStringToOString(
- inPath, RTL_TEXTENCODING_UTF8 ) );
+ inPath, RTL_TEXTENCODING_UTF8 ).getStr() );
HandleError( theRetVal, inPath, rEnv );
}
diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
index 56a4ca3c8513..0c80061aa8ed 100644
--- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
@@ -193,7 +193,7 @@ static rtl::OUString encodeValue( const rtl::OUString & rValue )
else
aResult.append( c );
}
- return rtl::OUString( aResult );
+ return aResult.makeStringAndClear();
}
//////////////////////////////////////////////////////////////////////////
@@ -304,7 +304,7 @@ static rtl::OUString decodeValue( const rtl::OUString & rValue )
nPos++;
}
- return rtl::OUString( aResult );
+ return aResult.makeStringAndClear();
}
//////////////////////////////////////////////////////////////////////////