diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-05-31 20:45:03 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-05-31 21:15:00 -0500 |
commit | 827865fee1dba85d4c3f986a23e4bd34b1a641f9 (patch) | |
tree | 70f92b92b8eeb8f0d722b5c4ee24c1e9488d95f4 /ucb/source/ucp/ftp | |
parent | e6ef9f128e85961921b0b319087010fce1d59a74 (diff) |
targeted string re-work
Change-Id: Ic08995a67a407576da475a6716b1218e45b60dfd
Diffstat (limited to 'ucb/source/ucp/ftp')
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontent.cxx | 50 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontentidentifier.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpcontentprovider.cxx | 11 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpresultsetI.cxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpresultsetbase.cxx | 20 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpurl.cxx | 18 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/test_ftpurl.cxx | 9 |
7 files changed, 47 insertions, 66 deletions
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index deba05ec9c1b..9d63b26022e0 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -175,10 +175,8 @@ XTYPEPROVIDER_IMPL_6( FTPContent, #define XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) XSERVICEINFO_IMPL_1( FTPContent, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.FTPContent")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.ucb.FTPContent"))); + rtl::OUString( "com.sun.star.comp.FTPContent"), + rtl::OUString( "com.sun.star.ucb.FTPContent")); @@ -192,7 +190,7 @@ XSERVICEINFO_IMPL_1( FTPContent, rtl::OUString SAL_CALL FTPContent::getContentType() throw( RuntimeException ) { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FTP_CONTENT_TYPE)); + return rtl::OUString(FTP_CONTENT_TYPE); } @@ -373,7 +371,7 @@ Any SAL_CALL FTPContent::execute( { Sequence<Any> seq(1); PropertyValue value; - value.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")); + value.Name = rtl::OUString("Uri"); value.Handle = -1; value.Value <<= m_aFTPURL.ident(false,false); value.State = PropertyState_DIRECT_VALUE; @@ -408,7 +406,7 @@ Any SAL_CALL FTPContent::execute( { Sequence<Any> seq(1); PropertyValue value; - value.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")); + value.Name = rtl::OUString("Uri"); value.Handle = -1; value.Value <<= m_aFTPURL.ident(false,false); value.State = PropertyState_DIRECT_VALUE; @@ -433,8 +431,7 @@ Any SAL_CALL FTPContent::execute( if(!(aCommand.Argument >>= Properties)) { aRet <<= IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Wrong argument type!" )), + rtl::OUString( "Wrong argument type!" ), static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -448,8 +445,7 @@ Any SAL_CALL FTPContent::execute( if( ! ( aCommand.Argument >>= propertyValues ) ) { aRet <<= IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Wrong argument type!" )), + rtl::OUString( "Wrong argument type!" ), static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -470,8 +466,7 @@ Any SAL_CALL FTPContent::execute( InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { aRet <<= IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Wrong argument type!" )), + rtl::OUString( "Wrong argument type!" ), static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -486,8 +481,7 @@ Any SAL_CALL FTPContent::execute( OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { aRet <<= IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Wrong argument type!" )), + rtl::OUString( "Wrong argument type!" ), static_cast< cppu::OWeakObject * >(this), -1); @@ -530,8 +524,7 @@ Any SAL_CALL FTPContent::execute( if(n) { Sequence<Any> seq(1); PropertyValue value; - value.Name = - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")); + value.Name = rtl::OUString("Uri"); value.Handle = -1; value.Value <<= m_aFTPURL.ident(false,false); value.State = PropertyState_DIRECT_VALUE; @@ -582,8 +575,7 @@ Any SAL_CALL FTPContent::execute( } else { aRet <<= IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Unexpected OpenMode!" )), + rtl::OUString( "Unexpected OpenMode!" ), static_cast< cppu::OWeakObject * >(this), -1); @@ -595,8 +587,7 @@ Any SAL_CALL FTPContent::execute( ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Wrong argument type!" )), + rtl::OUString( "Wrong argument type!" ), static_cast< cppu::OWeakObject * >(this), -1)), Environment); @@ -633,13 +624,9 @@ Any SAL_CALL FTPContent::execute( } } -#define FTP_FILE rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( \ - "application/" \ - "vnd.sun.staroffice.ftp-file")) +#define FTP_FILE rtl::OUString( "application/vnd.sun.staroffice.ftp-file") -#define FTP_FOLDER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( \ - "application/" \ - "vnd.sun.staroffice.ftp-folder")) +#define FTP_FOLDER rtl::OUString( "application/vnd.sun.staroffice.ftp-folder") Sequence<ContentInfo > SAL_CALL FTPContent::queryCreatableContentsInfo( ) @@ -660,7 +647,7 @@ FTPContent::queryCreatableContentsInfo_Static( ) | ContentInfoAttribute::KIND_DOCUMENT; Sequence< Property > props( 1 ); props[0] = Property( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")), + rtl::OUString("Title"), -1, getCppuType( static_cast< rtl::OUString* >( 0 ) ), PropertyAttribute::MAYBEVOID @@ -757,7 +744,7 @@ void FTPContent::insert(const InsertCommandArgument& aInsertCommand, if(m_bInserted && !m_bTitleSet) { MissingPropertiesException excep; excep.Properties.realloc(1); - excep.Properties[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + excep.Properties[0] = rtl::OUString("Title"); Any aAny; aAny <<= excep; ucbhelper::cancelCommandExecution(aAny,Env); } @@ -910,7 +897,7 @@ Sequence<Any> FTPContent::setPropertyValues( rtl::OUString OldTitle = m_aFTPURL.ren(Title); evt.realloc(1); evt[0].PropertyName = - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); + rtl::OUString("Title"); evt[0].Further = false; evt[0].PropertyHandle = -1; evt[0].OldValue <<= OldTitle; @@ -931,8 +918,7 @@ Sequence<Any> FTPContent::setPropertyValues( for(sal_Int32 j = 0; j < props.getLength(); ++j) if(props[j].Name == seqPropVal[i].Name) { ret[i] <<= IllegalAccessException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Property is read-only!")), + rtl::OUString( "Property is read-only!"), //props[j].Attributes & PropertyAttribute::READONLY // ? "Property is read-only!" // : "Access denied!"), diff --git a/ucb/source/ucp/ftp/ftpcontentidentifier.cxx b/ucb/source/ucp/ftp/ftpcontentidentifier.cxx index 9e76eee96cda..13d85ab65730 100644 --- a/ucb/source/ucp/ftp/ftpcontentidentifier.cxx +++ b/ucb/source/ucp/ftp/ftpcontentidentifier.cxx @@ -139,7 +139,7 @@ FTPContentIdentifier::getContentProviderScheme( com::sun::star::uno::RuntimeException ) { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ftp")); + return rtl::OUString("ftp"); } diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx index 427527937a52..a7b281129e62 100644 --- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx +++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx @@ -103,8 +103,8 @@ XTYPEPROVIDER_IMPL_3(FTPContentProvider, XSERVICEINFO_IMPL_1( FTPContentProvider, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.FTPContentProvider")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FTP_CONTENT_PROVIDER_SERVICE_NAME))); + rtl::OUString("com.sun.star.comp.FTPContentProvider"), + rtl::OUString(FTP_CONTENT_PROVIDER_SERVICE_NAME)); //========================================================================= // @@ -158,7 +158,7 @@ FTPContentProvider::queryContent( this); if(!m_pProxyDecider->shouldUseProxy( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ftp")), + rtl::OUString("ftp"), aURL.host(), aURL.port().toInt32())) { @@ -267,11 +267,10 @@ FTPContentProvider::getHttpProvider() if(xManager.is()) return xManager->queryContentProvider( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http:"))); + rtl::OUString("http:")); else throw RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "bad ucbhelper::ContentBroker")), + rtl::OUString( "bad ucbhelper::ContentBroker"), *this); } else return 0; diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index 130b9b76b593..a38185eac213 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -70,8 +70,7 @@ ResultSetI::ResultSetI(const Reference<XMultiServiceFactory>& xMSF, const rtl::OUString& Name = seqProp[i].Name; if(Name.compareToAscii("ContentType") == 0 ) xRow->appendString(seqProp[i], - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "application/ftp" ))); + rtl::OUString( "application/ftp" )); else if(Name.compareToAscii("Title") == 0) xRow->appendString(seqProp[i],dirvec[n].m_aName); else if(Name.compareToAscii("IsReadOnly") == 0) diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx index 8d8d73f28fc3..a876bce0f6c2 100644 --- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx @@ -510,12 +510,12 @@ ResultSetBase::getPropertySetInfo() throw( uno::RuntimeException) { uno::Sequence< beans::Property > seq(2); - seq[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")); + seq[0].Name = rtl::OUString("RowCount"); seq[0].Handle = -1; seq[0].Type = getCppuType( static_cast< sal_Int32* >(0) ); seq[0].Attributes = beans::PropertyAttribute::READONLY; - seq[1].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")); + seq[1].Name = rtl::OUString("IsRowCountFinal"); seq[1].Handle = -1; seq[1].Type = getCppuType( static_cast< sal_Bool* >(0) ); seq[1].Attributes = beans::PropertyAttribute::READONLY; @@ -535,8 +535,8 @@ void SAL_CALL ResultSetBase::setPropertyValue( lang::WrappedTargetException, uno::RuntimeException) { - if( aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")) || - aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) ) + if( aPropertyName == rtl::OUString("IsRowCountFinal") || + aPropertyName == rtl::OUString("RowCount") ) return; throw beans::UnknownPropertyException(); @@ -549,13 +549,13 @@ uno::Any SAL_CALL ResultSetBase::getPropertyValue( lang::WrappedTargetException, uno::RuntimeException) { - if( PropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")) ) + if( PropertyName == rtl::OUString("IsRowCountFinal") ) { uno::Any aAny; aAny <<= m_bRowCountFinal; return aAny; } - else if ( PropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) ) + else if ( PropertyName == rtl::OUString("RowCount") ) { uno::Any aAny; sal_Int32 count = m_aItems.size(); @@ -574,7 +574,7 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( lang::WrappedTargetException, uno::RuntimeException) { - if( aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")) ) + if( aPropertyName == rtl::OUString("IsRowCountFinal") ) { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pIsFinalListeners ) @@ -583,7 +583,7 @@ void SAL_CALL ResultSetBase::addPropertyChangeListener( m_pIsFinalListeners->addInterface( xListener ); } - else if ( aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) ) + else if ( aPropertyName == rtl::OUString("RowCount") ) { osl::MutexGuard aGuard( m_aMutex ); if ( ! m_pRowCountListeners ) @@ -603,13 +603,13 @@ void SAL_CALL ResultSetBase::removePropertyChangeListener( lang::WrappedTargetException, uno::RuntimeException) { - if( aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRowCountFinal")) && + if( aPropertyName == rtl::OUString("IsRowCountFinal") && m_pIsFinalListeners ) { osl::MutexGuard aGuard( m_aMutex ); m_pIsFinalListeners->removeInterface( aListener ); } - else if ( aPropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowCount")) && + else if ( aPropertyName == rtl::OUString("RowCount") && m_pRowCountListeners ) { osl::MutexGuard aGuard( m_aMutex ); diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 17f50e52a845..39f2a65686fa 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -136,9 +136,9 @@ FTPURL::FTPURL(const rtl::OUString& url, malformed_exception ) : m_pFCP(pFCP), - m_aUsername(RTL_CONSTASCII_USTRINGPARAM("anonymous")), + m_aUsername("anonymous"), m_bShowPassword(false), - m_aPort(RTL_CONSTASCII_USTRINGPARAM("21")) + m_aPort("21") { parse(url); // can reset m_bShowPassword } @@ -401,7 +401,7 @@ namespace ftp { // Setting username:password #define SET_USER_PASSWORD(username,password) \ rtl::OUString combi(username + \ - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":")) + \ + rtl::OUString(":") + \ password); \ rtl::OString aUserPsswd(combi.getStr(), \ combi.getLength(), \ @@ -549,7 +549,7 @@ rtl::OUString FTPURL::net_title() const if(try_more && 1+url.lastIndexOf(sal_Unicode('/')) != url.getLength()) - url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); // add end-slash + url += rtl::OUString("/"); // add end-slash else if(!try_more && 1+url.lastIndexOf(sal_Unicode('/')) == url.getLength()) url = url.copy(0,url.getLength()-1); // remove end-slash @@ -567,7 +567,7 @@ rtl::OUString FTPURL::net_title() const // Format of current working directory: // 257 "/bla/bla" is current directory sal_Int32 index1 = aNetTitle.lastIndexOf( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("257"))); + rtl::OUString("257")); index1 = 1+aNetTitle.indexOf(sal_Unicode('"'),index1); sal_Int32 index2 = aNetTitle.indexOf(sal_Unicode('"'),index1); aNetTitle = aNetTitle.copy(index1,index2-index1); @@ -595,7 +595,7 @@ rtl::OUString FTPURL::net_title() const aNetTitle = decodePathSegment(m_aPathSegmentVec.back()); else // must be root - aNetTitle = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + aNetTitle = rtl::OUString("/"); try_more = false; } @@ -729,7 +729,7 @@ void FTPURL::mkdir(bool ReplaceExisting) const rtl::OUString url(parent(true)); if(1+url.lastIndexOf(sal_Unicode('/')) != url.getLength()) - url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + url += rtl::OUString("/"); SET_URL(url); CURLcode err = curl_easy_perform(curl); @@ -769,7 +769,7 @@ rtl::OUString FTPURL::ren(const rtl::OUString& NewTitle) rtl::OUString url(parent(true)); if(1+url.lastIndexOf(sal_Unicode('/')) != url.getLength()) - url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + url += rtl::OUString("/"); SET_URL(url); CURLcode err = curl_easy_perform(curl); @@ -819,7 +819,7 @@ void FTPURL::del() const rtl::OUString url(parent(true)); if(1+url.lastIndexOf(sal_Unicode('/')) != url.getLength()) - url += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + url += rtl::OUString("/"); SET_URL(url); CURLcode err = curl_easy_perform(curl); diff --git a/ucb/source/ucp/ftp/test_ftpurl.cxx b/ucb/source/ucp/ftp/test_ftpurl.cxx index e2c2bb0f54aa..3e2a5c22a2dd 100644 --- a/ucb/source/ucp/ftp/test_ftpurl.cxx +++ b/ucb/source/ucp/ftp/test_ftpurl.cxx @@ -159,8 +159,7 @@ int test_ftplist(void) { FTPHandleProviderI provider; ftp::FTPURL url( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ftp://abi:psswd@abi-1/dir")), + rtl::OUString( "ftp://abi:psswd@abi-1/dir"), &provider); std::vector<ftp::FTPDirentry> vec = @@ -223,8 +222,7 @@ int test_ftpproperties(void) { FTPHandleProviderI provider; ftp::FTPURL url( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ftp://abi:psswd@abi-1/file")), + rtl::OUString( "ftp://abi:psswd@abi-1/file"), &provider); ftp::FTPDirentry ade(url.direntry()); @@ -243,8 +241,7 @@ int test_ftpopen(void) FTPHandleProviderI provider; ftp::FTPURL url( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ftp://abi:psswd@abi-1/file")), + rtl::OUString( "ftp://abi:psswd@abi-1/file"), &provider); FILE* file = url.open(); |