diff options
-rw-r--r-- | connectivity/source/drivers/dbase/DConnection.cxx | 47 | ||||
-rw-r--r-- | connectivity/source/inc/dbase/DConnection.hxx | 9 |
2 files changed, 47 insertions, 9 deletions
diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx index 0a79324e7e0c..b87fffc24d66 100644 --- a/connectivity/source/drivers/dbase/DConnection.cxx +++ b/connectivity/source/drivers/dbase/DConnection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: DConnection.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-05-17 06:46:55 $ + * last change: $Author: fs $ $Date: 2001-05-17 15:11:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -111,6 +111,45 @@ ODbaseConnection::~ODbaseConnection() { } +// -------------------------------------------------------------------------------- +void ODbaseConnection::construct(const ::rtl::OUString& _rUrl,const Sequence< PropertyValue >& _rInfo ) throw(SQLException) +{ + // check the arguments for settings which are not allowed here + // Normally, the base class would just ignore such settings. But there are settings which are recognized + // by the base class, but not allowed for ourself anymore. + + const PropertyValue* pSetting = _rInfo.getConstArray(); + const PropertyValue* pSettingEnd = pSetting + _rInfo.getLength(); + + Sequence< PropertyValue > aPatchedInfo(_rInfo); + // (cheap (till now) as the sequences are ref-counted) + PropertyValue* pNextPatchedInfo = NULL; + + for (;pSetting < pSettingEnd; ++pSetting) + { + if (0 == pSetting->Name.compareToAscii("Extension")) + { + if (!pNextPatchedInfo) + // never found such an invalid setting before + pNextPatchedInfo = aPatchedInfo.getArray() + (pSetting - _rInfo.getConstArray()); + } + else + { + if (pNextPatchedInfo) + { + *pNextPatchedInfo = *pSetting; + ++pNextPatchedInfo; + } + } + } + + if (pNextPatchedInfo) + // we omitted at least one setting + aPatchedInfo.realloc(pNextPatchedInfo - aPatchedInfo.getArray()); + + ODbaseConnection_Base::construct(_rUrl, aPatchedInfo); +} + // XServiceInfo // -------------------------------------------------------------------------------- IMPLEMENT_SERVICE_INFO(ODbaseConnection, "com.sun.star.sdbc.drivers.dbase.Connection", "com.sun.star.sdbc.Connection") @@ -176,7 +215,3 @@ Reference< XPreparedStatement > SAL_CALL ODbaseConnection::prepareCall( const :: return NULL; } -// ----------------------------------------------------------------------------- - - - diff --git a/connectivity/source/inc/dbase/DConnection.hxx b/connectivity/source/inc/dbase/DConnection.hxx index ae54645fe2be..d1fba3d846af 100644 --- a/connectivity/source/inc/dbase/DConnection.hxx +++ b/connectivity/source/inc/dbase/DConnection.hxx @@ -2,9 +2,9 @@ * * $RCSfile: DConnection.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: oj $ $Date: 2000-09-29 15:02:09 $ + * last change: $Author: fs $ $Date: 2001-05-17 15:09:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,12 +71,15 @@ namespace connectivity namespace dbase { class ODriver; - class ODbaseConnection : public file::OConnection + typedef file::OConnection ODbaseConnection_Base; + class ODbaseConnection : public ODbaseConnection_Base { public: ODbaseConnection(ODriver* _pDriver); virtual ~ODbaseConnection(); + virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException); + // XServiceInfo DECLARE_SERVICE_INFO(); |