summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/ado/AViews.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/ado/AViews.cxx')
-rw-r--r--connectivity/source/drivers/ado/AViews.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/connectivity/source/drivers/ado/AViews.cxx b/connectivity/source/drivers/ado/AViews.cxx
index 22fe40142d25..943422289627 100644
--- a/connectivity/source/drivers/ado/AViews.cxx
+++ b/connectivity/source/drivers/ado/AViews.cxx
@@ -28,6 +28,8 @@
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
#include <rtl/ref.hxx>
+#include <systools/win32/oleauto.hxx>
+
#include <strings.hrc>
using namespace ::comphelper;
@@ -61,7 +63,7 @@ Reference< XPropertySet > OViews::createDescriptor()
// XAppend
sdbcx::ObjectType OViews::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
{
- OAdoView* pView = getFromUnoTunnel<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) );
@@ -74,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 )
@@ -88,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));
}