diff options
author | José Guilherme Vanz <guilherme.sft@gmail.com> | 2012-11-30 22:53:43 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-12-01 14:40:25 +0000 |
commit | 8967f80a50cd59199cf77d3b2eccdc57095d8c02 (patch) | |
tree | bda005193cd48b0e2c6e3b0d58eedef5d18135df | |
parent | dd4edd93696140b7fae61268511886845d777645 (diff) |
Removal ::rtl:: prefixes and macros in IO
This commit removes some ::rtl:: prefixes and RTL_CONSTASCII_STRINGPARAM,
RTL_CONSTASCII_USTRINGPARAM macros in IO.
Change-Id: I9446ddf13ba18d2d80639afc9e1b61234945b115
Signed-off-by: José Guilherme Vanz <guilherme.sft@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1200
Reviewed-by: Olivier Hallot <olivier.hallot@alta.org.br>
Tested-by: Olivier Hallot <olivier.hallot@alta.org.br>
-rw-r--r-- | io/source/connector/connector.cxx | 40 | ||||
-rw-r--r-- | io/source/connector/connector.hxx | 12 | ||||
-rw-r--r-- | io/source/connector/ctr_pipe.cxx | 2 | ||||
-rw-r--r-- | io/source/connector/ctr_socket.cxx | 10 |
4 files changed, 28 insertions, 36 deletions
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx index 9ba335ba637e..38c2aee057bd 100644 --- a/io/source/connector/connector.cxx +++ b/io/source/connector/connector.cxx @@ -94,9 +94,7 @@ namespace stoc_connector Reference< XConnection > r; if ( aDesc.getName() == "pipe" ) { - rtl::OUString aName( - aDesc.getParameter( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("name")))); + OUString aName(aDesc.getParameter("name")); PipeConnection *pConn = new PipeConnection( sConnectionDescription ); @@ -106,43 +104,37 @@ namespace stoc_connector } else { - OUString sMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Connector : couldn't connect to pipe ")); + OUString sMessage("Connector : couldn't connect to pipe "); sMessage += aName; - sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM("(")); + sMessage += "("; sMessage += OUString::valueOf( (sal_Int32 ) pConn->m_pipe.getError() ); - sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")")); + sMessage += ")"; delete pConn; throw NoConnectException( sMessage ,Reference< XInterface > () ); } } else if ( aDesc.getName() == "socket" ) { - rtl::OUString aHost; - if (aDesc.hasParameter( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("host")))) - aHost = aDesc.getParameter( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("host"))); + OUString aHost; + if (aDesc.hasParameter("host")) + aHost = aDesc.getParameter("host"); else - aHost = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "localhost")); + aHost = "localhost"; sal_uInt16 nPort = static_cast< sal_uInt16 >( - aDesc.getParameter( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("port"))). + aDesc.getParameter("port"). toInt32()); bool bTcpNoDelay - = aDesc.getParameter( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "tcpnodelay"))).toInt32() != 0; + = aDesc.getParameter("tcpnodelay").toInt32() != 0; SocketConnection *pConn = new SocketConnection( sConnectionDescription); SocketAddr AddrTarget( aHost.pData, nPort ); if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok) { - OUString sMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Connector : couldn't connect to socket (")); + OUString sMessage("Connector : couldn't connect to socket ("); OUString sError = pConn->m_socket.getErrorAsString(); sMessage += sError; - sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")")); + sMessage += ")"; delete pConn; throw NoConnectException( sMessage, Reference < XInterface > () ); } @@ -157,7 +149,7 @@ namespace stoc_connector } else { - OUString delegatee = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Connector.")); + OUString delegatee("com.sun.star.connection.Connector."); delegatee += aDesc.getName(); OSL_TRACE( @@ -169,7 +161,7 @@ namespace stoc_connector if(!xConnector.is()) { - OUString message(RTL_CONSTASCII_USTRINGPARAM("Connector: unknown delegatee ")); + OUString message("Connector: unknown delegatee "); message += delegatee; throw ConnectionSetupException(message, Reference<XInterface>()); @@ -191,13 +183,13 @@ namespace stoc_connector Sequence< OUString > connector_getSupportedServiceNames() { Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME)); + seqNames.getArray()[0] = SERVICE_NAME; return seqNames; } OUString connector_getImplementationName() { - return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) ); + return OUString( IMPLEMENTATION_NAME ); } OUString OConnector::getImplementationName() throw() diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx index 1ab719038535..de4edef9960c 100644 --- a/io/source/connector/connector.hxx +++ b/io/source/connector/connector.hxx @@ -61,7 +61,7 @@ namespace stoc_connector { public: - PipeConnection( const ::rtl::OUString &sConnectionDescription ); + PipeConnection( const OUString &sConnectionDescription ); virtual ~PipeConnection(); virtual sal_Int32 SAL_CALL read( ::com::sun::star::uno::Sequence< sal_Int8 >& aReadBytes, @@ -77,12 +77,12 @@ namespace stoc_connector virtual void SAL_CALL close( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getDescription( ) + virtual OUString SAL_CALL getDescription( ) throw(::com::sun::star::uno::RuntimeException); public: ::osl::StreamPipe m_pipe; oslInterlockedCount m_nStatus; - ::rtl::OUString m_sDescription; + OUString m_sDescription; }; class SocketConnection : @@ -90,7 +90,7 @@ namespace stoc_connector { public: - SocketConnection( const ::rtl::OUString & sConnectionDescription ); + SocketConnection( const OUString & sConnectionDescription ); virtual ~SocketConnection(); virtual sal_Int32 SAL_CALL read( ::com::sun::star::uno::Sequence< sal_Int8 >& aReadBytes, @@ -106,7 +106,7 @@ namespace stoc_connector virtual void SAL_CALL close( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getDescription( ) + virtual OUString SAL_CALL getDescription( ) throw(::com::sun::star::uno::RuntimeException); @@ -122,7 +122,7 @@ namespace stoc_connector ::osl::ConnectorSocket m_socket; ::osl::SocketAddr m_addr; oslInterlockedCount m_nStatus; - ::rtl::OUString m_sDescription; + OUString m_sDescription; ::osl::Mutex _mutex; sal_Bool _started; diff --git a/io/source/connector/ctr_pipe.cxx b/io/source/connector/ctr_pipe.cxx index d84afc4b2f2f..ffb678668a8f 100644 --- a/io/source/connector/ctr_pipe.cxx +++ b/io/source/connector/ctr_pipe.cxx @@ -35,7 +35,7 @@ namespace stoc_connector { { g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt ); // make it unique - m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue=")); + m_sDescription += ",uniqueValue="; m_sDescription += OUString::valueOf( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&m_pipe)), diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx index f6103933a72a..7c9a9d4ad4dc 100644 --- a/io/source/connector/ctr_socket.cxx +++ b/io/source/connector/ctr_socket.cxx @@ -86,7 +86,7 @@ namespace stoc_connector { { // make it unique g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt ); - m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM( ",uniqueValue=" ) ); + m_sDescription += ",uniqueValue="; m_sDescription += OUString::valueOf( sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(&m_socket)), @@ -134,7 +134,7 @@ namespace stoc_connector { if(i != nBytesToRead && m_socket.getError() != osl_Socket_E_None) { - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::read: error - ")); + OUString message("ctr_socket.cxx:SocketConnection::read: error - "); message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -151,7 +151,7 @@ namespace stoc_connector { } else { - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::read: error - connection already closed")); + OUString message("ctr_socket.cxx:SocketConnection::read: error - connection already closed"); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -172,7 +172,7 @@ namespace stoc_connector { { if( m_socket.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() ) { - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::write: error - ")); + OUString message("ctr_socket.cxx:SocketConnection::write: error - "); message += m_socket.getErrorAsString(); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); @@ -187,7 +187,7 @@ namespace stoc_connector { } else { - OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::write: error - connection already closed")); + OUString message("ctr_socket.cxx:SocketConnection::write: error - connection already closed"); IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this))); |