diff options
Diffstat (limited to 'connectivity/source/drivers/ado/AViews.cxx')
-rw-r--r-- | connectivity/source/drivers/ado/AViews.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx index 77cc5abfae0f..943422289627 100644 --- a/connectivity/source/drivers/ado/AViews.cxx +++ b/connectivity/source/drivers/ado/AViews.cxx @@ -27,6 +27,9 @@ #include <comphelper/servicehelper.hxx> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> +#include <rtl/ref.hxx> +#include <systools/win32/oleauto.hxx> + #include <strings.hrc> using namespace ::comphelper; @@ -41,7 +44,7 @@ using namespace com::sun::star::container; sdbcx::ObjectType OViews::createObject(const OUString& _rName) { - OAdoView* pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName)); + rtl::Reference<OAdoView> pView = new OAdoView(isCaseSensitive(),m_aCollection.GetItem(_rName)); pView->setNew(false); return pView; } @@ -60,7 +63,7 @@ Reference< XPropertySet > OViews::createDescriptor() // XAppend sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - OAdoView* pView = getUnoTunnelImplementation<OAdoView>( descriptor ); + OAdoView* pView = dynamic_cast<OAdoView*>( descriptor.get() ); if ( pView == nullptr ) m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_VIEW_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) ); @@ -73,8 +76,8 @@ sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Referen aCommand.put_Name(sName); aCommand.put_CommandText(getString(descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_COMMAND)))); ADOViews* pViews = m_aCollection; - if(FAILED(pViews->Append(OLEString(sName).asBSTR(),aCommand))) - ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); + if (FAILED(pViews->Append(sal::systools::BStr(sName), aCommand))) + ADOS::ThrowException(m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); OTables* pTables = static_cast<OTables*>(static_cast<OCatalog&>(m_rParent).getPrivateTables()); if ( pTables ) @@ -87,7 +90,7 @@ sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Referen void OViews::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementName) { if(!m_aCollection.Delete(_sElementName)) - ADOS::ThrowException(*m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); + ADOS::ThrowException(m_pCatalog->getConnection()->getConnection(),static_cast<XTypeProvider*>(this)); } |