[Libreoffice-commits] .: connectivity/workben

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Sat Jun 2 17:15:41 PDT 2012


 connectivity/workben/iniParser/main.cxx    |    6 +--
 connectivity/workben/little/main.cxx       |   14 ++++----
 connectivity/workben/testmoz/main.cxx      |   48 ++++++++++++++---------------
 connectivity/workben/testmoz/mozthread.cxx |   46 +++++++++++++--------------
 4 files changed, 57 insertions(+), 57 deletions(-)

New commits:
commit be8c8f17897633016a25c1efc3352921c2d7fcbf
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jun 2 19:12:19 2012 -0500

    targeted string re-work
    
    Change-Id: I511ceb2929b9bd316455c6463a3495e2748befdd

diff --git a/connectivity/workben/iniParser/main.cxx b/connectivity/workben/iniParser/main.cxx
index 93148b9..f77cfc6 100644
--- a/connectivity/workben/iniParser/main.cxx
+++ b/connectivity/workben/iniParser/main.cxx
@@ -99,7 +99,7 @@ public:
             sal_uInt64 nSize = 0;
 
             osl_getFileSize(handle, &nSize);
-            OUString sectionName( RTL_CONSTASCII_USTRINGPARAM( "no name section" ));
+            OUString sectionName( "no name section" );
             while (true)
             {
                 sal_uInt64 nPos;
@@ -130,7 +130,7 @@ public:
                         sectionName =  OStringToOUString(
                             line.copy(nIndexStart + 1,nIndexEnd - nIndexStart -1).trim(), RTL_TEXTENCODING_ASCII_US );
                         if (!sectionName.getLength())
-                            sectionName = OUString(RTL_CONSTASCII_USTRINGPARAM("no name section"));
+                            sectionName = OUString("no name section");
 
                         ini_Section *aSection = &mAllSection[sectionName];
                         aSection->sName = sectionName;
@@ -186,7 +186,7 @@ int _cdecl main( int argc, char * argv[] )
 
 {
 
-    IniParser parser(OUString(RTL_CONSTASCII_USTRINGPARAM("test.ini")));
+    IniParser parser(OUString("test.ini"));
     parser.Dump();
     return 0;
 }
diff --git a/connectivity/workben/little/main.cxx b/connectivity/workben/little/main.cxx
index b7092a5..c5ac706 100644
--- a/connectivity/workben/little/main.cxx
+++ b/connectivity/workben/little/main.cxx
@@ -64,28 +64,28 @@ void _cdecl main( int argc, char * argv[] )
 
     try{
         Reference< ::com::sun::star::lang::XMultiServiceFactory > xFac =
-                createRegistryServiceFactory(OUString(RTL_CONSTASCII_USTRINGPARAM("g:\\office50\\program\\applicat.rdb")),OUString());
+                createRegistryServiceFactory(OUString("g:\\office50\\program\\applicat.rdb"),OUString());
         if(!xFac.is())
             return;
 
-        m_xDriver = Reference<XDriver>(xFac->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.driver.dbase.Driver"))),UNO_QUERY);
+        m_xDriver = Reference<XDriver>(xFac->createInstance(OUString("com.sun.star.sdbc.driver.dbase.Driver")),UNO_QUERY);
         if(m_xDriver.is())
         {
 
             Sequence<PropertyValue> aValue;
-    //      aValue.getArray()[0] = PropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("user")),0,makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("TEST1"))),PropertyState_DIRECT_VALUE);
-    //      aValue.getArray()[1] = PropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("password")),0,makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("TEST1"))),PropertyState_DIRECT_VALUE);
+    //      aValue.getArray()[0] = PropertyValue( OUString("user"),0,makeAny(OUString("TEST1")),PropertyState_DIRECT_VALUE);
+    //      aValue.getArray()[1] = PropertyValue( OUString("password"),0,makeAny(OUString("TEST1")),PropertyState_DIRECT_VALUE);
     //
-            m_xConnection = m_xDriver->connect(OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:g:\\")),aValue);
+            m_xConnection = m_xDriver->connect(OUString("sdbc:dbase:g:\\"),aValue);
             if(m_xConnection.is())
             {
                 Reference<XStatement> xStmt = m_xConnection->createStatement();
                 if(xStmt.is())
                 {
-                    Reference<XResultSet> xRes = xStmt->executeQuery(OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * FROM Tele")));
+                    Reference<XResultSet> xRes = xStmt->executeQuery(OUString("SELECT * FROM Tele"));
                     if(xRes.is())
                     {
-                        ::rtl::OUString aPat( RTL_CONSTASCII_USTRINGPARAM( "%s\t" ));
+                        ::rtl::OUString aPat( "%s\t" );
                         Reference<XRow> xRow(xRes,UNO_QUERY);
                         Reference<XResultSetMetaData> xMeta = Reference<XResultSetMetaDataSupplier>(xRes,UNO_QUERY)->getMetaData();
                         for(sal_Int32 i=1;i<xMeta->getColumnCount();++i)
diff --git a/connectivity/workben/testmoz/main.cxx b/connectivity/workben/testmoz/main.cxx
index 8d0bfc7..bb7df3b 100644
--- a/connectivity/workben/testmoz/main.cxx
+++ b/connectivity/workben/testmoz/main.cxx
@@ -215,19 +215,19 @@ Reference< XMultiServiceFactory > InitializeFac( void )
                     createRegistryServiceFactory( types, sal_True );
                 Reference< XImplementationRegistration > xIR(
                     interimSmgr->createInstance(
-                        OUString::(RTL_CONSTASCII_USTRINGPARAM(
-                            "com.sun.star.registry.ImplementationRegistration" )) ), UNO_QUERY );
+                        OUString::(
+                            "com.sun.star.registry.ImplementationRegistration" ) ), UNO_QUERY );
 
                 Reference< XSimpleRegistry > xReg(
                     interimSmgr->createInstance(
-                        OUString::(RTL_CONSTASCII_USTRINGPARAM(
-                            "com.sun.star.registry.SimpleRegistry" )) ), UNO_QUERY );
+                        OUString::(
+                            "com.sun.star.registry.SimpleRegistry" ) ), UNO_QUERY );
                 if ( xReg.is() )
                 {
                     xReg->open(services, sal_False, sal_True);
                     if ( xReg->isValid() )
                     {
-                        OUString loader( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.loader.SharedLibrary" ));
+                        OUString loader( "com.sun.star.loader.SharedLibrary" );
                         for( sal_Int32 i = 0; components[i] ; i ++ )
                         {
                             printf("Registering %s ... ", components[i]);
@@ -273,8 +273,8 @@ Reference< XMultiServiceFactory > InitializeFac( void )
         ucb::ContentBroker::get()->getContentProviderManagerInterface();
 
     Reference< XContentProvider > xFileProvider
-        ( xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider")) ), UNO_QUERY );
-    xUcb->registerContentProvider( xFileProvider, OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True );
+        ( xSMgr->createInstance( OUString("com.sun.star.ucb.FileContentProvider") ), UNO_QUERY );
+    xUcb->registerContentProvider( xFileProvider, OUString("file"), sal_True );
 
 
     globalUcb = xUcb;
@@ -297,10 +297,10 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
                     printf("Testing getColumns() : START\n");
                     {
                         Reference<XResultSet> xRes = xDmd->getColumns(
-                                makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // Schema
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // TabName
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%"))
+                                makeAny(OUString("")), // Catalog
+                                OUString("%"),          // Schema
+                                OUString("%"),          // TabName
+                                OUString("%")
                                 );
                         printXResultSets( xRes );
                     }
@@ -316,9 +316,9 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
                 printf("Testing getTables() : START\n");
                     {
                         Reference<XResultSet> xRes = xDmd->getTables(
-                                makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // Schema
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // TabName
+                                makeAny(OUString("")), // Catalog
+                                OUString("%"),          // Schema
+                                OUString("%"),          // TabName
                                 Sequence<rtl::OUString>()
                                 );
                         printXResultSets( xRes );
@@ -400,16 +400,16 @@ Reference< ::com::sun::star::sdbc::XConnection> TestConnected
     {
         case -1:
         case 1: //mozilla
-            url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:mozilla://"));
+            url=OUString("sdbc:address:mozilla://");
             break;
         case 2:
-            url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap://"));
+            url=OUString("sdbc:address:ldap://");
             char hostname[40],basedn[40];
             scanf("%s %s",hostname,basedn);
             aValue.realloc(2);
-            aValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HostName"));
+            aValue[0].Name = ::rtl::OUString("HostName");
             aValue[0].Value <<= rtl::OUString::createFromAscii(hostname);
-            aValue[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseDN"));
+            aValue[1].Name = ::rtl::OUString("BaseDN");
             aValue[1].Value <<= rtl::OUString::createFromAscii(basedn);
             break;
         case 3:
@@ -417,12 +417,12 @@ Reference< ::com::sun::star::sdbc::XConnection> TestConnected
             break;
         case 5:
             //Default LDAP AB
-            url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap://"));
+            url=OUString("sdbc:address:ldap://");
             aValue.realloc(2);
-            aValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HostName"));
-            aValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sun-ds"));
-            aValue[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseDN"));
-            aValue[1].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc=sun,dc=com"));
+            aValue[0].Name = ::rtl::OUString("HostName");
+            aValue[0].Value <<= rtl::OUString("sun-ds");
+            aValue[1].Name = ::rtl::OUString("BaseDN");
+            aValue[1].Value <<= rtl::OUString("dc=sun,dc=com");
             break;
         default:
             return pConnection;
@@ -640,7 +640,7 @@ int _cdecl main( int argc, char * argv[] )
     {
     Reference< ::com::sun::star::sdbc::XDriver>
     m_xDriver(xMgr->createInstance(
-           OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.MozabDriver"))),
+           OUString("com.sun.star.comp.sdbc.MozabDriver")),
              UNO_QUERY);
         if(m_xDriver.is())
     {
diff --git a/connectivity/workben/testmoz/mozthread.cxx b/connectivity/workben/testmoz/mozthread.cxx
index f24be56..ee69064 100755
--- a/connectivity/workben/testmoz/mozthread.cxx
+++ b/connectivity/workben/testmoz/mozthread.cxx
@@ -185,10 +185,10 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
         OSL_TRACE("Testing getColumns() : START");
         {
             Reference<XResultSet> xRes = xDmd->getColumns(
-                                makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // Schema
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // TabName
-                                OUString(RTL_CONSTASCII_USTRINGPARAM("%"))
+                                makeAny(OUString("")), // Catalog
+                                OUString("%"),          // Schema
+                                OUString("%"),          // TabName
+                                OUString("%")
                                 );
             printXResultSets( xRes );
         }
@@ -204,9 +204,9 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
         OSL_TRACE("Testing getTables() : START");
          {
             Reference<XResultSet> xRes = xDmd->getTables(
-                    makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog
-                    OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // Schema
-                    OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // TabName
+                    makeAny(OUString("")), // Catalog
+                    OUString("%"),          // Schema
+                    OUString("%"),          // TabName
                     Sequence<rtl::OUString>() );
             printXResultSets( xRes );
         }
@@ -229,7 +229,7 @@ void TestQuery(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
         OSL_TRACE(": got statement");
         OSL_TRACE(":   excuteQuery() : START \n");
 //      SELECT "First Name", "Display Name", "E-mail" FROM tablename
-        OUString sqlPrefix(RTL_CONSTASCII_USTRINGPARAM("SELECT  \"First Name\", \"Display Name\", \"E-mail\" FROM "));
+        OUString sqlPrefix("SELECT  \"First Name\", \"Display Name\", \"E-mail\" FROM ");
         try
         {
             sal_Int32 times=0;
@@ -240,9 +240,9 @@ void TestQuery(Reference< ::com::sun::star::sdbc::XConnection> &pConnection)
                 OUString qut      = xDmd->getIdentifierQuoteString();
 
                 Reference<XResultSet> xRes = xDmd->getTables(
-                    makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog
-                    OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // Schema
-                    OUString(RTL_CONSTASCII_USTRINGPARAM("%")),          // TabName
+                    makeAny(OUString("")), // Catalog
+                    OUString("%"),          // Schema
+                    OUString("%"),          // TabName
                         Sequence<rtl::OUString>() );
                 sal_Int32 nTables = 0;
                 while( xRes.is() && xRes->next())
@@ -295,24 +295,24 @@ Reference< ::com::sun::star::sdbc::XConnection> TestConnected
     switch( nIndex)
     {
     case testLDAP:
-        url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap://"));
+        url=OUString("sdbc:address:ldap://");
         aValue.realloc(2);
-        aValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HostName"));
-        aValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sun-ds"));
-        aValue[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseDN"));
-        aValue[1].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc=sun,dc=com"));
+        aValue[0].Name = ::rtl::OUString("HostName");
+        aValue[0].Value <<= rtl::OUString("sun-ds");
+        aValue[1].Name = ::rtl::OUString("BaseDN");
+        aValue[1].Value <<= rtl::OUString("dc=sun,dc=com");
         break;
     case testMozilla:
-        url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:mozilla://"));
+        url=OUString("sdbc:address:mozilla://");
         break;
     case testOp:
-        url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:outlook://"));
+        url=OUString("sdbc:address:outlook://");
         break;
     case testOe:
-        url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:outlookexp://"));
+        url=OUString("sdbc:address:outlookexp://");
         break;
     default:
-        url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:mozilla://"));
+        url=OUString("sdbc:address:mozilla://");
         break;
     }
     pConnection =
@@ -359,14 +359,14 @@ void SAL_CALL mozThread(void*)
     {
         Reference< ::com::sun::star::sdbc::XDriver>
         m_xDriver(mMgr->createInstance(
-           OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.MozabDriver"))),
+           OUString("com.sun.star.comp.sdbc.MozabDriver")),
              UNO_QUERY);
-       if(m_xDriver.is())
+        if(m_xDriver.is())
         {
 
            m_xConnection = TestConnected(m_xDriver);
            if(m_xConnection.is())
-                {
+           {
                 if (!TestMetaData(m_xConnection))
                 {
                     TestQuery(m_xConnection);


More information about the Libreoffice-commits mailing list