[Libreoffice-commits] .: io/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 02:21:28 PST 2012


 io/source/acceptor/acc_pipe.cxx   |   10 +++++-----
 io/source/acceptor/acc_socket.cxx |   14 +++++++-------
 io/source/acceptor/acceptor.cxx   |   32 ++++++++++++++------------------
 io/source/acceptor/acceptor.hxx   |   14 +++++++-------
 4 files changed, 33 insertions(+), 37 deletions(-)

New commits:
commit fead8bc949a3c61b29f353486feed3a882758c02
Author: José Guilherme Vanz <guilherme.sft at gmail.com>
Date:   Thu Nov 29 01:37:54 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: I823fcdfe46d4d4093118f6eaab89c1ce42883a6c
    Signed-off-by: José Guilherme Vanz <guilherme.sft at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/1194
    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/acceptor/acc_pipe.cxx b/io/source/acceptor/acc_pipe.cxx
index 73e3418..a8b8856 100644
--- a/io/source/acceptor/acc_pipe.cxx
+++ b/io/source/acceptor/acc_pipe.cxx
@@ -56,7 +56,7 @@ namespace io_acceptor
         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;
@@ -73,7 +73,7 @@ namespace io_acceptor
         g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
 
         // make it unique
-        m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue="));
+        m_sDescription += OUString(",uniqueValue=");
         m_sDescription += OUString::valueOf(
             sal::static_int_cast<sal_Int64 >(
                 reinterpret_cast< sal_IntPtr >(&m_pipe)),
@@ -162,7 +162,7 @@ namespace io_acceptor
         m_pipe = Pipe( m_sPipeName.pData , osl_Pipe_CREATE , osl::Security() );
         if( ! m_pipe.is() )
         {
-            OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: Couldn't setup pipe "));
+            OUString error = OUString("io.acceptor: Couldn't setup pipe ");
             error += m_sPipeName;
             throw ConnectionSetupException( error, Reference< XInterface > () );
         }
@@ -177,7 +177,7 @@ namespace io_acceptor
         }
         if( ! pipe.is() )
         {
-            OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: pipe already closed"));
+            OUString error = OUString("io.acceptor: pipe already closed");
             error += m_sPipeName;
             throw ConnectionSetupException( error, Reference< XInterface > () );
         }
@@ -197,7 +197,7 @@ namespace io_acceptor
         }
         else
         {
-            OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: Couldn't setup pipe "));
+            OUString error = OUString("io.acceptor: Couldn't setup pipe ");
             error += m_sPipeName;
             throw ConnectionSetupException( error, Reference< XInterface > ());
         }
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 8cfcfb6..1e50814 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -85,7 +85,7 @@ namespace io_acceptor {
         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);
 
         // XConnectionBroadcaster
@@ -100,7 +100,7 @@ namespace io_acceptor {
         ::osl::StreamSocket m_socket;
         ::osl::SocketAddr m_addr;
         oslInterlockedCount m_nStatus;
-        ::rtl::OUString m_sDescription;
+        OUString m_sDescription;
 
         ::osl::Mutex _mutex;
         sal_Bool     _started;
@@ -164,7 +164,7 @@ namespace io_acceptor {
     {
         g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
         // make it unique
-        m_sDescription += OUString( RTL_CONSTASCII_USTRINGPARAM( ",uniqueValue=" ) );
+        m_sDescription += OUString( ",uniqueValue=" ) ;
         m_sDescription += OUString::valueOf(
             sal::static_int_cast< sal_Int64 >(
                 reinterpret_cast< sal_IntPtr >(&m_socket)),
@@ -210,7 +210,7 @@ namespace io_acceptor {
 
             if(i != nBytesToRead)
             {
-                OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::read: error - "));
+                OUString message("acc_socket.cxx:SocketConnection::read: error - ");
                 message +=  m_socket.getErrorAsString();
 
                 IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
@@ -227,7 +227,7 @@ namespace io_acceptor {
         }
         else
         {
-            OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::read: error - connection already closed"));
+            OUString message("acc_socket.cxx:SocketConnection::read: error - connection already closed");
 
             IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
 
@@ -248,7 +248,7 @@ namespace io_acceptor {
         {
             if( m_socket.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() )
             {
-                OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::write: error - "));
+                OUString message("acc_socket.cxx:SocketConnection::write: error - ");
                 message += m_socket.getErrorAsString();
 
                 IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
@@ -263,7 +263,7 @@ namespace io_acceptor {
         }
         else
         {
-            OUString message(RTL_CONSTASCII_USTRINGPARAM("acc_socket.cxx:SocketConnection::write: error - connection already closed"));
+            OUString message("acc_socket.cxx:SocketConnection::write: error - connection already closed");
 
             IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
 
diff --git a/io/source/acceptor/acceptor.cxx b/io/source/acceptor/acceptor.cxx
index eb94ca5..a8bd18c 100644
--- a/io/source/acceptor/acceptor.cxx
+++ b/io/source/acceptor/acceptor.cxx
@@ -109,7 +109,7 @@ namespace io_acceptor
             {
                   if( *m_pFlag )
                   {
-                      OUString sMessage( RTL_CONSTASCII_USTRINGPARAM( "AlreadyAcceptingException :" ) );
+                      OUString sMessage( "AlreadyAcceptingException :" );
                       sMessage += sConnectionDescription;
                       throw AlreadyAcceptingException( sMessage , Reference< XInterface > () );
                   }
@@ -140,8 +140,7 @@ namespace io_acceptor
             m_sLastDescription != sConnectionDescription )
         {
             // instantiate another acceptor for different ports
-            OUString sMessage = OUString( RTL_CONSTASCII_USTRINGPARAM(
-                "acceptor::accept called multiple times with different conncetion strings\n" ) );
+            OUString sMessage = OUString("acceptor::accept called multiple times with different conncetion strings\n" );
             throw ConnectionSetupException( sMessage, Reference< XInterface > () );
         }
 
@@ -153,10 +152,9 @@ namespace io_acceptor
                 cppu::UnoUrlDescriptor aDesc(sConnectionDescription);
                 if ( aDesc.getName() == "pipe" )
                 {
-                    rtl::OUString aName(
+                    OUString aName(
                         aDesc.getParameter(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                                              "name"))));
+                            OUString("name")));
 
                     m_pPipe = new PipeAcceptor(aName, sConnectionDescription);
 
@@ -176,22 +174,20 @@ namespace io_acceptor
                 }
                 else if ( aDesc.getName() == "socket" )
                 {
-                    rtl::OUString aHost;
+                    OUString aHost;
                     if (aDesc.hasParameter(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("host"))))
+                            OUString("host")))
                         aHost = aDesc.getParameter(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("host")));
+                            OUString("host"));
                     else
-                        aHost = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                                                  "localhost"));
+                        aHost = OUString("localhost");
                     sal_uInt16 nPort = static_cast< sal_uInt16 >(
                         aDesc.getParameter(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("port"))).
+                            OUString("port")).
                         toInt32());
                     bool bTcpNoDelay
                         = aDesc.getParameter(
-                            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                                              "tcpnodelay"))).toInt32() != 0;
+                            OUString("tcpnodelay")).toInt32() != 0;
 
                     m_pSocket = new SocketAcceptor(
                         aHost, nPort, bTcpNoDelay, sConnectionDescription);
@@ -212,7 +208,7 @@ namespace io_acceptor
                 }
                 else
                 {
-                    OUString delegatee = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.connection.Acceptor."));
+                    OUString delegatee = OUString("com.sun.star.connection.Acceptor.");
                     delegatee += aDesc.getName();
 
                     OSL_TRACE(
@@ -224,7 +220,7 @@ namespace io_acceptor
 
                     if(!_xAcceptor.is())
                     {
-                        OUString message(RTL_CONSTASCII_USTRINGPARAM("Acceptor: unknown delegatee "));
+                        OUString message("Acceptor: unknown delegatee ");
                         message += delegatee;
 
                         throw ConnectionSetupException(message, Reference<XInterface>());
@@ -278,7 +274,7 @@ namespace io_acceptor
 
     OUString acceptor_getImplementationName()
     {
-        return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
+        return OUString( IMPLEMENTATION_NAME );
     }
 
     Reference< XInterface > SAL_CALL acceptor_CreateInstance( const Reference< XComponentContext > & xCtx)
@@ -289,7 +285,7 @@ namespace io_acceptor
     Sequence< OUString > acceptor_getSupportedServiceNames()
     {
         Sequence< OUString > seqNames(1);
-        seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME));
+        seqNames.getArray()[0] = OUString(SERVICE_NAME);
         return seqNames;
     }
 
diff --git a/io/source/acceptor/acceptor.hxx b/io/source/acceptor/acceptor.hxx
index 748068c..7bce857 100644
--- a/io/source/acceptor/acceptor.hxx
+++ b/io/source/acceptor/acceptor.hxx
@@ -30,7 +30,7 @@ namespace io_acceptor {
     class PipeAcceptor
     {
     public:
-        PipeAcceptor( const ::rtl::OUString &sPipeName , const ::rtl::OUString &sConnectionDescription );
+        PipeAcceptor( const OUString &sPipeName , const OUString &sConnectionDescription );
 
         void init();
         ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection >  accept(  );
@@ -39,18 +39,18 @@ namespace io_acceptor {
 
         ::osl::Mutex m_mutex;
         ::osl::Pipe m_pipe;
-        ::rtl::OUString m_sPipeName;
-        ::rtl::OUString m_sConnectionDescription;
+        OUString m_sPipeName;
+        OUString m_sConnectionDescription;
         sal_Bool m_bClosed;
     };
 
     class SocketAcceptor
     {
     public:
-        SocketAcceptor( const ::rtl::OUString & sSocketName ,
+        SocketAcceptor( const OUString & sSocketName ,
                         sal_uInt16 nPort,
                         sal_Bool bTcpNoDelay,
-                        const ::rtl::OUString &sConnectionDescription );
+                        const OUString &sConnectionDescription );
 
         void init();
         ::com::sun::star::uno::Reference < ::com::sun::star::connection::XConnection > accept();
@@ -59,8 +59,8 @@ namespace io_acceptor {
 
         ::osl::SocketAddr m_addr;
         ::osl::AcceptorSocket m_socket;
-        ::rtl::OUString m_sSocketName;
-        ::rtl::OUString m_sConnectionDescription;
+        OUString m_sSocketName;
+        OUString m_sConnectionDescription;
         sal_uInt16 m_nPort;
         sal_Bool m_bTcpNoDelay;
         sal_Bool m_bClosed;


More information about the Libreoffice-commits mailing list