[Libreoffice-commits] .: io/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 1 06:40:44 PST 2012


 io/source/connector/connector.cxx  |   40 ++++++++++++++-----------------------
 io/source/connector/connector.hxx  |   12 +++++------
 io/source/connector/ctr_pipe.cxx   |    2 -
 io/source/connector/ctr_socket.cxx |   10 ++++-----
 4 files changed, 28 insertions(+), 36 deletions(-)

New commits:
commit 8967f80a50cd59199cf77d3b2eccdc57095d8c02
Author: José Guilherme Vanz <guilherme.sft at gmail.com>
Date:   Fri Nov 30 22:53:43 2012 -0200

    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 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/1200
    Reviewed-by: Olivier Hallot <olivier.hallot at alta.org.br>
    Tested-by: Olivier Hallot <olivier.hallot at alta.org.br>

diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 9ba335b..38c2aee 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 1ab7190..de4edef 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 d84afc4..ffb6786 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 f610393..7c9a9d4 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)));
 


More information about the Libreoffice-commits mailing list