diff options
Diffstat (limited to 'connectivity/source/drivers/dbase/DIndexes.cxx')
-rw-r--r-- | connectivity/source/drivers/dbase/DIndexes.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx index 1ebce2612098..df630c531c3e 100644 --- a/connectivity/source/drivers/dbase/DIndexes.cxx +++ b/connectivity/source/drivers/dbase/DIndexes.cxx @@ -24,18 +24,12 @@ #include <unotools/ucbhelper.hxx> #include <strings.hrc> -using namespace ::comphelper; - using namespace utl; using namespace ::connectivity; using namespace ::dbtools; using namespace ::connectivity::dbase; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::sdbc; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; sdbcx::ObjectType ODbaseIndexes::createObject(const OUString& _rName) { @@ -63,7 +57,7 @@ sdbcx::ObjectType ODbaseIndexes::createObject(const OUString& _rName) ReadHeader(*pFileStream, aHeader); pFileStream.reset(); - ODbaseIndex* pIndex = new ODbaseIndex(m_pTable,aHeader,_rName); + rtl::Reference<ODbaseIndex> pIndex = new ODbaseIndex(m_pTable,aHeader,_rName); xRet = pIndex; pIndex->openIndexFile(); } @@ -92,14 +86,9 @@ Reference< XPropertySet > ODbaseIndexes::createDescriptor() // XAppend sdbcx::ObjectType ODbaseIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { - Reference<XUnoTunnel> xTunnel(descriptor,UNO_QUERY); - if(xTunnel.is()) - { - ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelId()) ); - if(!pIndex) - throw SQLException(); + ODbaseIndex* pIndex = dynamic_cast<ODbaseIndex*>(descriptor.get()); + if(pIndex) pIndex->CreateImpl(); - } return createObject( _rForName ); } @@ -107,7 +96,7 @@ sdbcx::ObjectType ODbaseIndexes::appendObject( const OUString& _rForName, const // XDrop void ODbaseIndexes::dropObject(sal_Int32 _nPos, const OUString& /*_sElementName*/) { - auto pIndex = comphelper::getUnoTunnelImplementation<ODbaseIndex>(getObject(_nPos)); + rtl::Reference<ODbaseIndex> pIndex = dynamic_cast<ODbaseIndex*>(getObject(_nPos).get()); if ( pIndex ) pIndex->DropImpl(); } |