diff options
Diffstat (limited to 'ucb/source/ucp/gvfs/gvfs_content.cxx')
-rw-r--r-- | ucb/source/ucp/gvfs/gvfs_content.cxx | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 121c69346f..c166da3cb3 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,7 +32,8 @@ #include <unistd.h> #include <sys/types.h> -#include "osl/time.h" +#include <sal/macros.h> +#include <osl/time.h> #include <osl/diagnose.h> #include "osl/doublecheckedlocking.h" @@ -247,7 +249,7 @@ uno::Sequence< uno::Type > SAL_CALL Content::getTypes() rtl::OUString SAL_CALL Content::getImplementationName() throw( uno::RuntimeException ) { - return rtl::OUString::createFromAscii("com.sun.star.comp.GnomeVFSContent" ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.GnomeVFSContent")); } uno::Sequence< rtl::OUString > SAL_CALL Content::getSupportedServiceNames() @@ -267,9 +269,9 @@ rtl::OUString SAL_CALL Content::getContentType() throw( uno::RuntimeException ) { if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) - return rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( GVFS_FOLDER_TYPE )); else - return rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( GVFS_FILE_TYPE )); } // @@ -279,7 +281,7 @@ rtl::OUString SAL_CALL Content::getContentType() uno::Any Content::getBadArgExcept() { return uno::makeAny( lang::IllegalArgumentException - ( rtl::OUString::createFromAscii( "Wrong argument type!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong argument type!")), static_cast< cppu::OWeakObject * >( this ), -1 ) ); } @@ -515,7 +517,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) rtl::OUString aURL = getOUURI(); if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() ) - aURL += rtl::OUString::createFromAscii( "/" ); + aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); name = create_document ? "[New_Content]" : "[New_Collection]"; // This looks problematic to me cf. webdav @@ -704,7 +706,7 @@ static lang::IllegalAccessException getReadOnlyException( Content *ctnt ) { return lang::IllegalAccessException - ( rtl::OUString::createFromAscii( "Property is read-only!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only!")), static_cast< cppu::OWeakObject * >( ctnt ) ); } @@ -713,7 +715,7 @@ Content::makeNewURL( const char */*newName*/ ) { rtl::OUString aNewURL = getParentURL(); if ( aNewURL.lastIndexOf( '/' ) != ( aNewURL.getLength() - 1 ) ) - aNewURL += rtl::OUString::createFromAscii( "/" ); + aNewURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); char *name = gnome_vfs_escape_string( m_info.name ); aNewURL += GnomeToOUString( name ); @@ -808,7 +810,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( rValue.Value >>= aNewTitle ) { if ( aNewTitle.getLength() <= 0 ) aRet[ n ] <<= lang::IllegalArgumentException - ( rtl::OUString::createFromAscii( "Empty title not allowed!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Empty title not allowed!")), static_cast< cppu::OWeakObject * >( this ), -1 ); else { char *newName = OUStringToGnome( aNewTitle ); @@ -818,7 +820,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( g_warning ("Set new name to '%s'", newName); #endif - aEvent.PropertyName = rtl::OUString::createFromAscii( "Title" ); + aEvent.PropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); aEvent.OldValue = uno::makeAny( GnomeToOUString( newInfo.name ) ); aEvent.NewValue = uno::makeAny( aNewTitle ); aChanges.getArray()[ nChanged ] = aEvent; @@ -831,7 +833,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( } } else aRet[ n ] <<= beans::IllegalTypeException - ( rtl::OUString::createFromAscii( "Property value has wrong type!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property value has wrong type!")), static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) || @@ -868,7 +870,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aGuard.clear(); if (!exchangeIdentity( xNewId ) ) aRet[ nTitlePos ] <<= uno::Exception - ( rtl::OUString::createFromAscii( "Exchange failed!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Exchange failed!")), static_cast< cppu::OWeakObject * >( this ) ); } } @@ -897,7 +899,7 @@ void Content::queryChildren( ContentRefList& rChildren ) sal_Int32 nURLPos = aURL.lastIndexOf( '/' ); if ( nURLPos != ( aURL.getLength() - 1 ) ) - aURL += rtl::OUString::createFromAscii( "/" ); + aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); sal_Int32 nLen = aURL.getLength(); @@ -1032,7 +1034,7 @@ void Content::transfer(const ucb::TransferInfo & /*rArgs*/, ucbhelper::cancelCommandExecution ( uno::makeAny ( ucb::InteractiveBadTransferURLException - ( rtl::OUString::createFromAscii( "Unsupported URL scheme!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unsupported URL scheme!")), static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1186,7 +1188,7 @@ uno::Any Content::mapVFSException( const GnomeVFSResult result, sal_Bool bWrite aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); aException <<= ucb::InteractiveAugmentedIOException - ( rtl::OUString::createFromAscii( "Not found!" ), + ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Not found!")), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, @@ -1354,7 +1356,7 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) }; - const int nProps = sizeof (aGenericProperties) / sizeof (aGenericProperties[0]); + const int nProps = SAL_N_ELEMENTS(aGenericProperties); return uno::Sequence< beans::Property > ( aGenericProperties, nProps ); @@ -1645,9 +1647,17 @@ extern "C" { ucbhelper::InteractionSupplyAuthentication > & xSupp = xRequest->getAuthenticationSupplier(); - aUserName = xSupp->getUserName(); - aDomain = xSupp->getRealm(); - aPassword = xSupp->getPassword(); + ::rtl::OUString aNewDomain, aNewUserName, aNewPassword; + + aNewUserName = xSupp->getUserName(); + if ( aNewUserName.getLength() ) + aUserName = aNewUserName; + aNewDomain = xSupp->getRealm(); + if ( aNewDomain.getLength() ) + aDomain = aNewDomain; + aNewPassword = xSupp->getPassword(); + if ( aNewPassword.getLength() ) + aPassword = aNewPassword; { osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); @@ -1815,3 +1825,5 @@ gvfs::Authentication::~Authentication() refresh_auth( vq ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |