User: hr      
Date: 06/06/19 18:41:52

Modified:
 /dba/connectivity/source/drivers/mozab/
  MConnection.cxx

Log:
 INTEGRATION: CWS warnings01 (1.19.28); FILE MERGED
 2006/06/13 08:47:23 fs 1.19.28.7: #i66334# don't load error resource without 
error id
 2006/05/18 12:06:19 fs 1.19.28.6: #i65444#
 2006/04/07 20:22:18 sb 1.19.28.5: RESYNC: (1.19-1.20); FILE MERGED
 2006/03/29 12:39:24 fs 1.19.28.4: getSdbcSceme not reachable for the driver - 
need to locate symbol on demand
 2005/11/21 10:07:51 fs 1.19.28.3: #i57457# warning-free code on unx*
 2005/11/16 12:59:12 fs 1.19.28.2: #i57457# warning free code
 2005/11/07 14:43:44 fs 1.19.28.1: #i57457# warning-free code

File Changes:

Directory: /dba/connectivity/source/drivers/mozab/
==================================================

File [changed]: MConnection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MConnection.cxx?r1=1.20&r2=1.21
Delta lines:  +62 -66
---------------------
--- MConnection.cxx     29 Mar 2006 12:17:15 -0000      1.20
+++ MConnection.cxx     20 Jun 2006 01:41:49 -0000      1.21
@@ -59,6 +59,9 @@
 #ifndef _DBHELPER_DBEXCEPTION_HXX_
 #include <connectivity/dbexception.hxx>
 #endif
+#ifndef CONNECTIVITY_DIAGNOSE_EX_H
+#include "diagnose_ex.h"
+#endif
 
 #ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
 #include <comphelper/officeresourcebundle.hxx>
@@ -77,8 +80,6 @@
        return (new connectivity::mozab::OConnection( 
reinterpret_cast<connectivity::mozab::MozabDriver*>(_pDriver) ));
 }
 
-
-using namespace connectivity::mozab;
 using namespace dbtools;
 
 
//------------------------------------------------------------------------------
@@ -89,56 +90,49 @@
 using namespace com::sun::star::sdbcx;
 // 
--------------------------------------------------------------------------------
 
-namespace connectivity
+namespace connectivity { namespace mozab {
+
+// =====================================================================
+// = ConnectionImplData
+// =====================================================================
+struct ConnectionImplData
 {
-    namespace mozab
-    {
-        // 
=====================================================================
-        // = ConnectionImplData
-        // 
=====================================================================
-        struct ConnectionImplData
-        {
             ::boost::shared_ptr< ::comphelper::OfficeResourceBundle >   
pResourceBundle;
-        };
-    }
-}
-
+};
 
 // 
-----------------------------------------------------------------------------
-const sal_Char* OConnection::getSDBC_SCHEME_MOZILLA()
+const sal_Char* getSdbcScheme( SdbcScheme _eScheme )
 {
-       static sal_Char*    SDBC_SCHEME_MOZILLA                 = 
MOZAB_MOZILLA_SCHEMA;
-       return SDBC_SCHEME_MOZILLA;
-}
-// 
-----------------------------------------------------------------------------
-const sal_Char* OConnection::getSDBC_SCHEME_THUNDERBIRD()
-{
-       static sal_Char*    SDBC_SCHEME_THUNDERBIRD                     = 
MOZAB_THUNDERBIRD_SCHEMA;
-       return SDBC_SCHEME_THUNDERBIRD;
-}
-// 
-----------------------------------------------------------------------------
-const sal_Char* OConnection::getSDBC_SCHEME_LDAP()
-{
-       static sal_Char*    SDBC_SCHEME_LDAP            = MOZAB_LDAP_SCHEMA;
-       return SDBC_SCHEME_LDAP;
-}
-// 
-----------------------------------------------------------------------------
-const sal_Char* OConnection::getSDBC_SCHEME_OUTLOOK_MAPI()
-{
-       static sal_Char*    SDBC_SCHEME_OUTLOOK_MAPI    = MOZAB_OUTLOOK_SCHEMA;
-       return SDBC_SCHEME_OUTLOOK_MAPI;
+    switch ( _eScheme )
+    {
+        case SDBC_MOZILLA:          return "mozilla";
+        case SDBC_THUNDERBIRD:      return "thunderbird";
+        case SDBC_LDAP:             return "ldap";
+        case SDBC_OUTLOOK_MAPI:     return "outlook";
+        case SDBC_OUTLOOK_EXPRESS:  return "outlookexp";
+    }
+    return NULL;
 }
 // 
-----------------------------------------------------------------------------
-const sal_Char* OConnection::getSDBC_SCHEME_OUTLOOK_EXPRESS()
+::rtl::OUString OConnection::getDriverImplementationName()
 {
-       static sal_Char*    SDBC_SCHEME_OUTLOOK_EXPRESS = 
MOZAB_OUTLOOKEXP_SCHEMA;
-       return SDBC_SCHEME_OUTLOOK_EXPRESS;
+       return rtl::OUString::createFromAscii(MOZAB_DRIVER_IMPL_NAME);
 }
+
 // 
-----------------------------------------------------------------------------
-::rtl::OUString OConnection::getDriverImplementationName()
+const sal_Char* getSchemeURI( MozillaScheme _eScheme )
 {
-       return rtl::OUString::createFromAscii(MOZAB_DRIVER_IMPL_NAME);
+    switch ( _eScheme )
+    {
+    case SCHEME_MOZILLA          : return "moz-abdirectory://";
+    case SCHEME_MOZILLA_MDB      : return "moz-abmdbdirectory://";
+    case SCHEME_LDAP             : return "moz-abldapdirectory://";
+    case SCHEME_OUTLOOK_MAPI     : return "moz-aboutlookdirectory://op/";
+    case SCHEME_OUTLOOK_EXPRESS  : return "moz-aboutlookdirectory://oe/";
+    }
+    return NULL;
 }
+
 // 
-----------------------------------------------------------------------------
 
 OConnection::OConnection(MozabDriver*  _pDriver)
@@ -242,25 +236,25 @@
         m_sPassword = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(""));
         m_bUseSSL   = sal_False;
 
-    if ( aAddrbookScheme.compareToAscii( getSDBC_SCHEME_MOZILLA() ) == 0 ) {
-        m_sMozillaURI = rtl::OUString::createFromAscii( MOZ_SCHEME_MOZILLA );
+    if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_MOZILLA ) ) == 0 
) {
+        m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( 
SCHEME_MOZILLA ) );
                m_eSDBCAddressType = SDBCAddress::Mozilla;
                if(sAdditionalInfo.getLength())
                        m_sMozillaProfile = sAdditionalInfo;
     }
        else
-    if ( aAddrbookScheme.compareToAscii( getSDBC_SCHEME_THUNDERBIRD() ) == 0 ) 
{
-        //Yes. I am sure it is MOZ_SCHEME_MOZILLA
-        m_sMozillaURI = rtl::OUString::createFromAscii( MOZ_SCHEME_MOZILLA );
+    if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_THUNDERBIRD ) ) 
== 0 ) {
+        //Yes. I am sure it is SCHEME_MOZILLA
+        m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( 
SCHEME_MOZILLA ) );
                m_eSDBCAddressType = SDBCAddress::ThunderBird;
                if(sAdditionalInfo.getLength())
                        m_sMozillaProfile = sAdditionalInfo;
     }
-    else if ( aAddrbookScheme.compareToAscii( getSDBC_SCHEME_LDAP() ) == 0 ) {
+    else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_LDAP ) ) == 
0 ) {
         rtl::OUString sBaseDN;
         sal_Int32     nPortNumber = -1;
 
-        m_sMozillaURI = rtl::OUString::createFromAscii( MOZ_SCHEME_LDAP );
+        m_sMozillaURI = rtl::OUString::createFromAscii( getSchemeURI( 
SCHEME_LDAP ) );
                m_eSDBCAddressType = SDBCAddress::LDAP;
 
         if ( !m_sHostName.getLength() )
@@ -344,12 +338,12 @@
                m_sMozillaURI += ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))"));
 
     }
-    else if ( aAddrbookScheme.compareToAscii( getSDBC_SCHEME_OUTLOOK_MAPI() ) 
== 0 ) {
-        m_sMozillaURI          = ::rtl::OUString::createFromAscii( 
MOZ_SCHEME_OUTLOOK_MAPI );
+    else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( SDBC_OUTLOOK_MAPI 
) ) == 0 ) {
+        m_sMozillaURI       = ::rtl::OUString::createFromAscii( getSchemeURI( 
SCHEME_OUTLOOK_MAPI ) );
                m_eSDBCAddressType = SDBCAddress::Outlook;
     }
-    else if ( aAddrbookScheme.compareToAscii( getSDBC_SCHEME_OUTLOOK_EXPRESS() 
) == 0 ) {
-        m_sMozillaURI          = rtl::OUString::createFromAscii( 
MOZ_SCHEME_OUTLOOK_EXPRESS );
+    else if ( aAddrbookScheme.compareToAscii( getSdbcScheme( 
SDBC_OUTLOOK_EXPRESS ) ) == 0 ) {
+        m_sMozillaURI       = rtl::OUString::createFromAscii( getSchemeURI( 
SCHEME_OUTLOOK_EXPRESS ) );
                m_eSDBCAddressType = SDBCAddress::OutlookExp;
     }
     else
@@ -418,8 +412,9 @@
 // 
--------------------------------------------------------------------------------
 Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const 
::rtl::OUString& _sSql ) throw(SQLException, RuntimeException)
 {
+    OSL_UNUSED( _sSql );
+    ::dbtools::throwFeatureNotImplementedException( 
"XConnection::prepareCall", *this );
     OSL_TRACE("OConnection::prepareCall( %s )", OUtoCStr( _sSql ) );
-       // not implemented yet :-) a task to do
        return NULL;
 }
 // 
--------------------------------------------------------------------------------
@@ -432,9 +427,9 @@
        return _sSql;
 }
 // 
--------------------------------------------------------------------------------
-void SAL_CALL OConnection::setAutoCommit( sal_Bool autoCommit ) 
throw(SQLException, RuntimeException)
+void SAL_CALL OConnection::setAutoCommit( sal_Bool /*autoCommit*/ ) 
throw(SQLException, RuntimeException)
 {
-       // here you  have to set your commit mode please have a look at the 
jdbc documentation to get a clear explanation
+    ::dbtools::throwFeatureNotImplementedException( 
"XConnection::setAutoCommit", *this );
 }
 // 
--------------------------------------------------------------------------------
 sal_Bool SAL_CALL OConnection::getAutoCommit(  ) throw(SQLException, 
RuntimeException)
@@ -480,9 +475,9 @@
        return xMetaData;
 }
 // 
--------------------------------------------------------------------------------
-void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) 
throw(SQLException, RuntimeException)
+void SAL_CALL OConnection::setReadOnly( sal_Bool /*readOnly*/ ) 
throw(SQLException, RuntimeException)
 {
-       // set you connection to readonly
+    ::dbtools::throwFeatureNotImplementedException( 
"XConnection::setReadOnly", *this );
 }
 // 
--------------------------------------------------------------------------------
 sal_Bool SAL_CALL OConnection::isReadOnly(  ) throw(SQLException, 
RuntimeException)
@@ -491,9 +486,9 @@
        return sal_False;
 }
 // 
--------------------------------------------------------------------------------
-void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) 
throw(SQLException, RuntimeException)
+void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& /*catalog*/ ) 
throw(SQLException, RuntimeException)
 {
-       // if your database doesn't work with catalogs you go to next method 
otherwise you kjnow what to do
+    ::dbtools::throwFeatureNotImplementedException( "XConnection::setCatalog", 
*this );
 }
 // 
--------------------------------------------------------------------------------
 ::rtl::OUString SAL_CALL OConnection::getCatalog(  ) throw(SQLException, 
RuntimeException)
@@ -502,10 +497,9 @@
        return ::rtl::OUString();
 }
 // 
--------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 level ) 
throw(SQLException, RuntimeException)
+void SAL_CALL OConnection::setTransactionIsolation( sal_Int32 /*level*/ ) 
throw(SQLException, RuntimeException)
 {
-       // set your isolation level
-       // please have a look at @see com.sun.star.sdbc.TransactionIsolation
+    ::dbtools::throwFeatureNotImplementedException( 
"XConnection::setTransactionIsolation", *this );
 }
 // 
--------------------------------------------------------------------------------
 sal_Int32 SAL_CALL OConnection::getTransactionIsolation(  ) 
throw(SQLException, RuntimeException)
@@ -520,9 +514,9 @@
        return NULL;
 }
 // 
--------------------------------------------------------------------------------
-void SAL_CALL OConnection::setTypeMap( const Reference< 
::com::sun::star::container::XNameAccess >& typeMap ) throw(SQLException, 
RuntimeException)
+void SAL_CALL OConnection::setTypeMap( const Reference< 
::com::sun::star::container::XNameAccess >& /*typeMap*/ ) throw(SQLException, 
RuntimeException)
 {
-       // the other way around
+    ::dbtools::throwFeatureNotImplementedException( "XConnection::setTypeMap", 
*this );
 }
 // 
--------------------------------------------------------------------------------
 // XCloseable
@@ -613,7 +607,9 @@
         // this means that we're disposed, and how could anybody request us to 
throw an exception then?
 
     ::rtl::OUString sErrorMessage;
-    if ( pResourceBundle.get() )
+    if ( pResourceBundle.get() && _nErrorResourceId )
         sErrorMessage = pResourceBundle->loadString( _nErrorResourceId );
     ::dbtools::throwGenericSQLException( sErrorMessage, *this );
 }
+
+} } // namespace connectivity::mozab




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to