Tag: cws_dev300_dba31a
User: oj      
Date: 2008-07-04 14:27:18+0000
Modified:
   dba/dbaccess/source/core/dataaccess/datasource.cxx
   dba/dbaccess/source/core/dataaccess/datasource.hxx

Log:
 #i81899# handle config data for JavaDriverClassPath

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: datasource.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.cxx?r1=1.79&r2=1.79.8.1
Delta lines:  +30 -5
--------------------
--- datasource.cxx      2008-06-25 12:32:03+0000        1.79
+++ datasource.cxx      2008-07-04 14:27:13+0000        1.79.8.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: datasource.cxx,v $
- * $Revision: 1.79 $
+ * $Revision: 1.79.8.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -111,9 +111,9 @@
 #ifndef _COMPHELPER_GUARDING_HXX_
 #include <comphelper/guarding.hxx>
 #endif
-#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
 #include <unotools/sharedunocomponent.hxx>
-#endif
+#include <unotools/confignode.hxx>
+
 #ifndef _RTL_DIGEST_H_
 #include <rtl/digest.h>
 #endif
@@ -828,6 +828,8 @@
                 m_pImpl->getDefaultDataSourceSettings()
             );
 
+            impl_insertJavaDriverClassPath_nothrow(aDriverInfo);
+
                        if ( m_pImpl->isEmbeddedDatabase() )
                        {
                                sal_Int32 nCount = aDriverInfo.getLength();
@@ -1501,6 +1503,29 @@
     return *const_cast< ODatabaseSource* >( this );
 }
 // 
-----------------------------------------------------------------------------
+void ODatabaseSource::impl_insertJavaDriverClassPath_nothrow(Sequence< 
PropertyValue >& _rDriverInfo)
+{
+    Reference< XPropertySet > xPropertySet( m_pImpl->m_xSettings, 
UNO_QUERY_THROW );
+    ::rtl::OUString sJavaDriverClass;
+    
xPropertySet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass")))
 >>= sJavaDriverClass;
+    if ( sJavaDriverClass.getLength() )
+    {
+        static const ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/JDBC/DriverNames"));
+        ::utl::OConfigurationTreeRoot aNamesRoot = 
::utl::OConfigurationTreeRoot::createWithServiceFactory(
+            m_pImpl->m_aContext.getLegacyServiceFactory(), s_sNodeName, -1, 
::utl::OConfigurationTreeRoot::CM_READONLY);
+        if ( aNamesRoot.isValid() && aNamesRoot.hasByName( sJavaDriverClass ) )
+        {
+            ::utl::OConfigurationNode aRegisterObj = aNamesRoot.openNode( 
sJavaDriverClass );
+            static const ::rtl::OUString 
s_sPath(RTL_CONSTASCII_USTRINGPARAM("Path"));
+            ::rtl::OUString sURL;
+            aRegisterObj.getNodeValue(s_sPath) >>= sURL;
+            sal_Int32 nCount = _rDriverInfo.getLength();
+               _rDriverInfo.realloc(nCount + 2 );
+               _rDriverInfo[nCount].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClassPath"));
+               _rDriverInfo[nCount++].Value <<= sURL;
+        }
+    }
+}
 //........................................................................
 }      // namespace dbaccess
 //........................................................................

File [changed]: datasource.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/datasource.hxx?r1=1.43&r2=1.43.8.1
Delta lines:  +4 -2
-------------------
--- datasource.hxx      2008-06-25 12:32:23+0000        1.43
+++ datasource.hxx      2008-07-04 14:27:14+0000        1.43.8.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: datasource.hxx,v $
- * $Revision: 1.43 $
+ * $Revision: 1.43.8.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -299,6 +299,8 @@
 
        void clearConnections();
 
+    void 
impl_insertJavaDriverClassPath_nothrow(::com::sun::star::uno::Sequence< 
::com::sun::star::beans::PropertyValue >& _rDriverInfo);
+
 protected:
     using ::cppu::OPropertySetHelper::getFastPropertyValue;
 };




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

Reply via email to