Tag: cws_dev300_dba31a User: fs Date: 2008-07-18 21:46:47+0000 Modified: dba/dbaccess/source/core/dataaccess/datasource.cxx
Log: #i81899# impl_insertJavaDriverClassPath_nothrow: don't pass empty values to the info sequence 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.8.1&r2=1.79.8.2 Delta lines: +36 -87 --------------------- --- datasource.cxx 2008-07-04 14:27:13+0000 1.79.8.1 +++ datasource.cxx 2008-07-18 21:46:45+0000 1.79.8.2 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: datasource.cxx,v $ - * $Revision: 1.79.8.1 $ + * $Revision: 1.79.8.2 $ * * This file is part of OpenOffice.org. * @@ -42,91 +42,41 @@ #include "SharedConnection.hxx" #include "databasedocument.hxx" -#ifndef _TOOLS_DEBUG_HXX -#include <tools/debug.hxx> -#endif -#ifndef TOOLS_DIAGNOSE_EX_H -#include <tools/diagnose_ex.h> -#endif -#ifndef _URLOBJ_HXX -#include <tools/urlobj.hxx> -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ -#include <cppuhelper/typeprovider.hxx> -#endif -#ifndef _COMPHELPER_SEQSTREAM_HXX -#include <comphelper/seqstream.hxx> -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include <comphelper/sequence.hxx> -#endif -#ifndef _COMPHELPER_PROPERTY_HXX_ -#include <comphelper/property.hxx> -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ -#include <comphelper/extract.hxx> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ -#include <com/sun/star/sdbc/XDriverAccess.hpp> -#endif -#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ -#include <com/sun/star/lang/DisposedException.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XDRIVERMANAGER_HPP_ -#include <com/sun/star/sdbc/XDriverManager.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ -#include <com/sun/star/sdbcx/XTablesSupplier.hpp> -#endif -#ifndef _COM_SUN_STAR_UCB_XINTERACTIONSUPPLYAUTHENTICATION_HPP_ -#include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp> -#endif -#ifndef _COM_SUN_STAR_UCB_AUTHENTICATIONREQUEST_HPP_ -#include <com/sun/star/ucb/AuthenticationRequest.hpp> -#endif -#ifndef _COM_SUN_STAR_REFLECTION_XPROXYFACTORY_HPP_ -#include <com/sun/star/reflection/XProxyFactory.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_ +/** === begin UNO includes === **/ #include <com/sun/star/beans/NamedValue.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_ -#include <com/sun/star/beans/XPropertyContainer.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_ #include <com/sun/star/beans/PropertyState.hpp> -#endif -#ifndef _TYPELIB_TYPEDESCRIPTION_HXX_ -#include <typelib/typedescription.hxx> -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include <connectivity/dbexception.hxx> -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ -#include <comphelper/interaction.hxx> -#endif -#ifndef _COMPHELPER_GUARDING_HXX_ -#include <comphelper/guarding.hxx> -#endif -#include <unotools/sharedunocomponent.hxx> -#include <unotools/confignode.hxx> - -#ifndef _RTL_DIGEST_H_ -#include <rtl/digest.h> -#endif -#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_ -#include <com/sun/star/embed/XTransactedObject.hpp> -#endif -#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTSUBSTORAGESUPPLIER_HPP_ +#include <com/sun/star/beans/XPropertyContainer.hpp> #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp> -#endif - #include <com/sun/star/document/XEventBroadcaster.hpp> -#include <com/sun/star/view/XPrintable.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/reflection/XProxyFactory.hpp> +#include <com/sun/star/sdbc/XDriverAccess.hpp> +#include <com/sun/star/sdbc/XDriverManager.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> +#include <com/sun/star/ucb/AuthenticationRequest.hpp> +#include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp> #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/view/XPrintable.hpp> +/** === end UNO includes === **/ + +#include <comphelper/extract.hxx> +#include <comphelper/guarding.hxx> +#include <comphelper/interaction.hxx> +#include <comphelper/namedvaluecollection.hxx> +#include <comphelper/property.hxx> +#include <comphelper/seqstream.hxx> +#include <comphelper/sequence.hxx> +#include <connectivity/dbexception.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <rtl/digest.h> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> +#include <tools/urlobj.hxx> +#include <typelib/typedescription.hxx> +#include <unotools/confignode.hxx> +#include <unotools/sharedunocomponent.hxx> #include <algorithm> @@ -1510,19 +1460,18 @@ 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")); + static const ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/JDBC/DriverClassPaths")); ::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; + OSL_VERIFY( aRegisterObj.getNodeValue( "Path" ) >>= sURL ); + + ::comphelper::NamedValueCollection aDriverSettings( _rDriverInfo ); + aDriverSettings.put( "JavaDriverClassPath", sURL ); + aDriverSettings >>= _rDriverInfo; } } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
