[Libreoffice-commits] core.git: connectivity/source

Stephan Bergmann sbergman at redhat.com
Fri Jan 6 09:54:17 UTC 2017


 connectivity/source/drivers/odbc/OConnection.cxx |   37 +++++++----------------
 1 file changed, 12 insertions(+), 25 deletions(-)

New commits:
commit c2b24cd6fbcc70e279b5c4c742911453dafe02a0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 6 10:53:34 2017 +0100

    Use string literals directly
    
    Change-Id: Ia4ae5c01ae7eb976a0e9638f8bc8fe7ebab8e2cb

diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 66f3146..9e0b3d1 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -191,68 +191,55 @@ SQLRETURN OConnection::Construct(const OUString& url,const Sequence< PropertyVal
     OUString aDSN("DSN="), aUID, aPWD, aSysDrvSettings;
     aDSN += url.copy(nLen+1);
 
-    const char* pUser       = "user";
-    const char* pTimeout    = "Timeout";
-    const char* pSilent     = "Silent";
-    const char* pPwd        = "password";
-    const char* pUseCatalog = "UseCatalog";
-    const char* pSysDrv     = "SystemDriverSettings";
-    const char* pCharSet    = "CharSet";
-    const char* pParaName   = "ParameterNameSubstitution";
-    const char* pPrivName   = "IgnoreDriverPrivileges";
-    const char* pVerColName = "PreventGetVersionColumns";   // #i60273#
-    const char* pRetrieving = "IsAutoRetrievingEnabled";
-    const char* pRetriStmt  = "AutoRetrievingStatement";
-
     sal_Int32 nTimeout = 20;
     bool bSilent = true;
     const PropertyValue *pBegin = info.getConstArray();
     const PropertyValue *pEnd   = pBegin + info.getLength();
     for(;pBegin != pEnd;++pBegin)
     {
-        if( pBegin->Name.equalsAscii(pTimeout))
+        if( pBegin->Name == "Timeout")
             OSL_VERIFY( pBegin->Value >>= nTimeout );
-        else if( pBegin->Name.equalsAscii(pSilent))
+        else if( pBegin->Name == "Silent")
             OSL_VERIFY( pBegin->Value >>= bSilent );
-        else if( pBegin->Name.equalsAscii(pPrivName))
+        else if( pBegin->Name == "IgnoreDriverPrivileges")
             OSL_VERIFY( pBegin->Value >>= m_bIgnoreDriverPrivileges );
-        else if( pBegin->Name.equalsAscii(pVerColName))
+        else if( pBegin->Name == "PreventGetVersionColumns")
             OSL_VERIFY( pBegin->Value >>= m_bPreventGetVersionColumns );
-        else if( pBegin->Name.equalsAscii(pParaName))
+        else if( pBegin->Name == "ParameterNameSubstitution")
             OSL_VERIFY( pBegin->Value >>= m_bParameterSubstitution );
-        else if( pBegin->Name.equalsAscii(pRetrieving))
+        else if( pBegin->Name == "IsAutoRetrievingEnabled")
         {
             bool bAutoRetrievingEnabled = false;
             OSL_VERIFY( pBegin->Value >>= bAutoRetrievingEnabled );
             enableAutoRetrievingEnabled(bAutoRetrievingEnabled);
         }
-        else if( pBegin->Name.equalsAscii(pRetriStmt))
+        else if( pBegin->Name == "AutoRetrievingStatement")
         {
             OUString sGeneratedValueStatement;
             OSL_VERIFY( pBegin->Value >>= sGeneratedValueStatement );
             setAutoRetrievingStatement(sGeneratedValueStatement);
         }
-        else if( pBegin->Name.equalsAscii(pUser))
+        else if( pBegin->Name == "user")
         {
             OSL_VERIFY( pBegin->Value >>= aUID );
             aDSN = aDSN + ";UID=" + aUID;
         }
-        else if( pBegin->Name.equalsAscii(pPwd))
+        else if( pBegin->Name == "password")
         {
             OSL_VERIFY( pBegin->Value >>= aPWD );
             aDSN = aDSN + ";PWD=" + aPWD;
         }
-        else if( pBegin->Name.equalsAscii(pUseCatalog))
+        else if( pBegin->Name == "UseCatalog")
         {
              OSL_VERIFY( pBegin->Value >>= m_bUseCatalog );
         }
-        else if( pBegin->Name.equalsAscii(pSysDrv))
+        else if( pBegin->Name == "SystemDriverSettings")
         {
             OSL_VERIFY( pBegin->Value >>= aSysDrvSettings );
             aDSN += ";";
             aDSN += aSysDrvSettings;
         }
-        else if( pBegin->Name.equalsAscii(pCharSet))
+        else if( pBegin->Name == "CharSet")
         {
             OUString sIanaName;
             OSL_VERIFY( pBegin->Value >>= sIanaName );


More information about the Libreoffice-commits mailing list