diff options
-rw-r--r-- | connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx | 22 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/ATables.cxx | 22 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AView.cxx | 47 | ||||
-rw-r--r-- | connectivity/source/drivers/ado/AViews.cxx | 45 | ||||
-rw-r--r-- | connectivity/source/inc/ado/ACatalog.hxx | 7 | ||||
-rw-r--r-- | connectivity/source/inc/ado/ATables.hxx | 5 | ||||
-rw-r--r-- | connectivity/source/inc/ado/AView.hxx | 13 | ||||
-rw-r--r-- | connectivity/source/inc/ado/Awrapadox.hxx | 6 |
8 files changed, 67 insertions, 100 deletions
diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx index d1df1587247f..ac6170da4129 100644 --- a/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx +++ b/connectivity/source/drivers/ado/ADatabaseMetaDataImpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ADatabaseMetaDataImpl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: oj $ $Date: 2001-09-17 14:09:15 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -666,23 +666,5 @@ void WpADOUser::Create() operator=(pCommand); } // ------------------------------------------------------------------------- -void WpADOView::Create() -{ - IClassFactory2* pIUnknown = NULL; - IUnknown *pOuter = NULL; - HRESULT hr = -1; - ADOView* pCommand; - hr = CoCreateInstance(ADOS::CLSID_ADOVIEW_25, - NULL, - CLSCTX_INPROC_SERVER, - ADOS::IID_ADOVIEW_25, - (void**)&pCommand ); - - - if( !FAILED( hr ) ) - operator=(pCommand); -} - -// ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/ATables.cxx b/connectivity/source/drivers/ado/ATables.cxx index 8d7354919777..6661f02c3826 100644 --- a/connectivity/source/drivers/ado/ATables.cxx +++ b/connectivity/source/drivers/ado/ATables.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ATables.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-11-09 07:05:38 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,7 +95,11 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_H_ +#include <cppuhelper/interfacecontainer.h> +#endif +using namespace ::cppu; using namespace connectivity; using namespace comphelper; using namespace connectivity::ado; @@ -158,5 +162,19 @@ Reference< XNamed > OTables::cloneObject(const Reference< XPropertySet >& _xDesc return Reference< XNamed >(); } // ----------------------------------------------------------------------------- +void OTables::appendNew(const ::rtl::OUString& _rsNewTable) +{ + OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid"); + m_aCollection.Refresh(); + + insertElement(_rsNewTable,NULL); + + // notify our container listeners + ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any()); + OInterfaceIteratorHelper aListenerLoop(m_aContainerListeners); + while (aListenerLoop.hasMoreElements()) + static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent); +} +// ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx index 560dfa80382b..54843bd8a9bf 100644 --- a/connectivity/source/drivers/ado/AView.cxx +++ b/connectivity/source/drivers/ado/AView.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AView.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: oj $ $Date: 2001-08-24 06:13:55 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,11 +76,15 @@ #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif +#ifndef _COMPHELPER_TYPES_HXX_ +#include <comphelper/types.hxx> +#endif #ifndef CONNECTIVITY_CONNECTION_HXX #include "TConnection.hxx" #endif // ------------------------------------------------------------------------- +using namespace comphelper; using namespace connectivity::ado; using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -90,37 +94,8 @@ using namespace com::sun::star::sdbc; // IMPLEMENT_SERVICE_INFO(OAdoView,"com.sun.star.sdbcx.AView","com.sun.star.sdbcx.View"); // ------------------------------------------------------------------------- OAdoView::OAdoView(sal_Bool _bCase,ADOView* _pView) : OView_ADO(_bCase,NULL) +,m_aView(_pView) { - construct(); - - if(_pView) - m_aView = WpADOView(_pView); - else - m_aView.Create(); -} -// ------------------------------------------------------------------------- -OAdoView::OAdoView(sal_Bool _bCase, const ::rtl::OUString& _Name, - sal_Int32 _CheckOption, - const ::rtl::OUString& _Command, - const ::rtl::OUString& _SchemaName, - const ::rtl::OUString& _CatalogName) - : OView_ADO( _bCase, - _Name, - NULL, - _CheckOption, - _Command, - _SchemaName, - _CatalogName) -{ - construct(); - m_aView.Create(); - WpADOCommand aCommand; - aCommand.Create(); - aCommand.put_Name(_Name); - aCommand.put_CommandText(_Command); - - m_aView.put_Command(OLEVariant((IDispatch*)aCommand)); - } //-------------------------------------------------------------------------- Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId() @@ -150,11 +125,6 @@ sal_Int64 OAdoView::getSomething( const Sequence< sal_Int8 > & rId ) throw (Runt } // ------------------------------------------------------------------------- -void OAdoView::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) throw (Exception) -{ - throw Exception(); -} -// ------------------------------------------------------------------------- void OAdoView::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const { if(m_aView.IsValid()) @@ -184,9 +154,10 @@ void OAdoView::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const break; } } + else + OView_ADO::getFastPropertyValue(rValue,nHandle); } // ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- void SAL_CALL OAdoView::acquire() throw(::com::sun::star::uno::RuntimeException) { OView_ADO::acquire(); diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx index 800181fa108f..a702fea16f28 100644 --- a/connectivity/source/drivers/ado/AViews.cxx +++ b/connectivity/source/drivers/ado/AViews.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AViews.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: oj $ $Date: 2001-11-09 07:05:38 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -64,20 +64,8 @@ #ifndef _CONNECTIVITY_ADO_VIEW_HXX_ #include "ado/AView.hxx" #endif -#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_ -#include <com/sun/star/sdbc/XRow.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HPP_ -#include <com/sun/star/sdbc/XResultSet.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_COLUMNVALUE_HPP_ -#include <com/sun/star/sdbc/ColumnValue.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBC_KEYRULE_HPP_ -#include <com/sun/star/sdbc/KeyRule.hpp> -#endif -#ifndef _COM_SUN_STAR_SDBCX_KEYTYPE_HPP_ -#include <com/sun/star/sdbcx/KeyType.hpp> +#ifndef _CONNECTIVITY_ADO_TABLES_HXX_ +#include "ado/ATables.hxx" #endif #ifndef _CONNECTIVITY_ADO_CATALOG_HXX_ #include "ado/ACatalog.hxx" @@ -107,7 +95,9 @@ using namespace com::sun::star::container; Reference< XNamed > OViews::createObject(const ::rtl::OUString& _rName) { - return new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName)); + OAdoView* pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName)); + pView->setNew(sal_False); + return pView; } // ------------------------------------------------------------------------- void OViews::impl_refresh( ) throw(RuntimeException) @@ -127,9 +117,24 @@ void OViews::appendObject( const Reference< XPropertySet >& descriptor ) OAdoView* pView = NULL; if(getImplementation(pView,descriptor) && pView != NULL) { - ADOViews* pViews = (ADOViews*)m_aCollection; - if(FAILED(pViews->Append(OLEString(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)))),pView->getImpl()))) - ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this); + WpADOCommand aCommand; + aCommand.Create(); + if(aCommand.IsValid()) + { + ::rtl::OUString sName; + descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sName; + aCommand.put_Name(sName); + aCommand.put_CommandText(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)))); + ADOViews* pViews = (ADOViews*)m_aCollection; + if(FAILED(pViews->Append(OLEString(sName),aCommand))) + ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),*this); + + OTables* pTables = static_cast<OTables*>(static_cast<OCatalog&>(m_rParent).getPrivateTables()); + if(pTables) + pTables->appendNew(sName); + } + else + throw SQLException(::rtl::OUString::createFromAscii("Could not append view!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); } else throw SQLException(::rtl::OUString::createFromAscii("Could not append view!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any()); diff --git a/connectivity/source/inc/ado/ACatalog.hxx b/connectivity/source/inc/ado/ACatalog.hxx index dbc99f046c0d..3c7c827b7ea1 100644 --- a/connectivity/source/inc/ado/ACatalog.hxx +++ b/connectivity/source/inc/ado/ACatalog.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ACatalog.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:14:24 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -88,7 +88,8 @@ namespace connectivity public: OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon); - OConnection* getConnection() { return m_pConnection; } + OConnection* getConnection() const { return m_pConnection; } + sdbcx::OCollection* getPrivateTables() const { return m_pTables;} }; } } diff --git a/connectivity/source/inc/ado/ATables.hxx b/connectivity/source/inc/ado/ATables.hxx index ff88197866ba..13733c3d6cb5 100644 --- a/connectivity/source/inc/ado/ATables.hxx +++ b/connectivity/source/inc/ado/ATables.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ATables.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: oj $ $Date: 2001-11-09 06:59:00 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,6 +99,7 @@ namespace connectivity { OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid"); } + void appendNew(const ::rtl::OUString& _rsNewTable); }; } } diff --git a/connectivity/source/inc/ado/AView.hxx b/connectivity/source/inc/ado/AView.hxx index ff0e812d6bd3..39827aa8b67c 100644 --- a/connectivity/source/inc/ado/AView.hxx +++ b/connectivity/source/inc/ado/AView.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AView.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: hr $ $Date: 2001-10-17 18:13:31 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:50:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,21 +82,12 @@ namespace connectivity protected: // OPropertySetHelper - virtual void SAL_CALL setFastPropertyValue_NoBroadcast( - sal_Int32 nHandle, - const ::com::sun::star::uno::Any& rValue) - throw (::com::sun::star::uno::Exception); virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; public: OAdoView(sal_Bool _bCase, ADOView* _pView=NULL); - OAdoView(sal_Bool _bCase, const ::rtl::OUString& _rName, - sal_Int32 _nCheckOption = 0, - const ::rtl::OUString& _rCommand = ::rtl::OUString(), - const ::rtl::OUString& _rSchemaName = ::rtl::OUString(), - const ::rtl::OUString& _rCatalogName = ::rtl::OUString()); // com::sun::star::lang::XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); diff --git a/connectivity/source/inc/ado/Awrapadox.hxx b/connectivity/source/inc/ado/Awrapadox.hxx index fe0082181f79..605cea3272c7 100644 --- a/connectivity/source/inc/ado/Awrapadox.hxx +++ b/connectivity/source/inc/ado/Awrapadox.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Awrapadox.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: oj $ $Date: 2001-11-09 06:59:00 $ + * last change: $Author: oj $ $Date: 2001-11-15 10:51:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -241,8 +241,6 @@ namespace connectivity inline WpADOView& operator=(const WpADOView& rhs) {WpOLEBase<ADOView>::operator=(rhs); return *this;} - void Create(); - ::rtl::OUString get_Name() const; void get_Command(OLEVariant& _rVar) const; void put_Command(OLEVariant& _rVar); |