XUnoTunnel->dynamic_cast in connectivityy
Change-Id: Ibe5e87a1ef1bdc11451e8fe240d017f1ef60dfe6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145556 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
0250d6c643
commit
f025dcc44c
@ -66,20 +66,6 @@ OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection)
|
||||
}
|
||||
|
||||
|
||||
Sequence< sal_Int8 > OAdoColumn::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoColumn::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OColumn_ADO>{});
|
||||
}
|
||||
|
||||
void OAdoColumn::construct()
|
||||
{
|
||||
sal_Int32 nAttrib = isNew() ? 0 : PropertyAttribute::READONLY;
|
||||
|
@ -62,7 +62,7 @@ Reference< XPropertySet > OColumns::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OColumns::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
rtl::Reference<OAdoColumn> pColumn = getFromUnoTunnel<OAdoColumn>( descriptor );
|
||||
rtl::Reference<OAdoColumn> pColumn = dynamic_cast<OAdoColumn*>( descriptor.get() );
|
||||
Reference< XPropertySet > xColumn;
|
||||
if ( !pColumn.is() )
|
||||
{
|
||||
|
@ -69,21 +69,6 @@ void OAdoGroup::refreshUsers()
|
||||
m_pUsers.reset(new OUsers(m_pCatalog, m_aMutex, aVector, aUsers, isCaseSensitive()));
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > OAdoGroup::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoGroup::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OGroup_ADO>{});
|
||||
}
|
||||
|
||||
|
||||
void OAdoGroup::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
|
||||
{
|
||||
if(m_aGroup.IsValid())
|
||||
|
@ -58,7 +58,7 @@ Reference< XPropertySet > OGroups::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OGroups::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
OAdoGroup* pGroup = getFromUnoTunnel<OAdoGroup>(descriptor);
|
||||
OAdoGroup* pGroup = dynamic_cast<OAdoGroup*>(descriptor.get());
|
||||
if ( pGroup == nullptr )
|
||||
m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_GROUP_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
||||
|
||||
|
@ -70,20 +70,6 @@ void OAdoIndex::refreshColumns()
|
||||
}
|
||||
|
||||
|
||||
Sequence< sal_Int8 > OAdoIndex::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoIndex::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<sdbcx::OIndex>{});
|
||||
}
|
||||
|
||||
void SAL_CALL OAdoIndex::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
|
||||
{
|
||||
if(m_aIndex.IsValid())
|
||||
|
@ -58,7 +58,7 @@ Reference< XPropertySet > OIndexes::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OIndexes::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
OAdoIndex* pIndex = getFromUnoTunnel<OAdoIndex>(descriptor);
|
||||
OAdoIndex* pIndex = dynamic_cast<OAdoIndex*>(descriptor.get());
|
||||
if ( pIndex == nullptr )
|
||||
m_pConnection->throwGenericSQLException( STR_INVALID_INDEX_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
||||
|
||||
|
@ -66,20 +66,6 @@ void OAdoKey::refreshColumns()
|
||||
m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, isCaseSensitive(), m_pConnection));
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > OAdoKey::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoKey::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OKey_ADO>{});
|
||||
}
|
||||
|
||||
void OAdoKey::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
|
||||
{
|
||||
if(m_aKey.IsValid())
|
||||
|
@ -58,7 +58,7 @@ Reference< XPropertySet > OKeys::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OKeys::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
OAdoKey* pKey = getFromUnoTunnel<OAdoKey>( descriptor );
|
||||
OAdoKey* pKey = dynamic_cast<OAdoKey*>( descriptor.get() );
|
||||
if ( pKey == nullptr)
|
||||
m_pConnection->throwGenericSQLException( STR_INVALID_KEY_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
||||
|
||||
|
@ -127,20 +127,6 @@ void OAdoTable::refreshIndexes()
|
||||
m_xIndexes.reset(new OIndexes(*this,m_aMutex,aVector,aIndexes,isCaseSensitive(),m_pCatalog->getConnection()));
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > OAdoTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OTable_TYPEDEF>{});
|
||||
}
|
||||
|
||||
// XRename
|
||||
void SAL_CALL OAdoTable::rename( const OUString& newName )
|
||||
{
|
||||
@ -165,7 +151,7 @@ void SAL_CALL OAdoTable::alterColumnByName( const OUString& colName, const Refer
|
||||
checkDisposed(OTableDescriptor_BASE_TYPEDEF::rBHelper.bDisposed);
|
||||
|
||||
bool bError = true;
|
||||
OAdoColumn* pColumn = comphelper::getFromUnoTunnel<OAdoColumn>(descriptor);
|
||||
OAdoColumn* pColumn = dynamic_cast<OAdoColumn*>(descriptor.get());
|
||||
if(pColumn != nullptr)
|
||||
{
|
||||
WpADOColumns aColumns = m_aTable.get_Columns();
|
||||
|
@ -65,7 +65,7 @@ Reference< XPropertySet > OTables::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OTables::appendObject( const OUString&, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
OAdoTable* pTable = getFromUnoTunnel<OAdoTable>( descriptor );
|
||||
OAdoTable* pTable = dynamic_cast<OAdoTable*>( descriptor.get() );
|
||||
if ( pTable == nullptr )
|
||||
m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_TABLE_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
||||
|
||||
|
@ -65,21 +65,6 @@ void OAdoUser::refreshGroups()
|
||||
m_pGroups.reset(new OGroups(m_pCatalog, m_aMutex, aVector, aGroups, isCaseSensitive()));
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > OAdoUser::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoUser::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OUser_TYPEDEF>{});
|
||||
}
|
||||
|
||||
|
||||
void OAdoUser::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)
|
||||
{
|
||||
if(m_aUser.IsValid())
|
||||
|
@ -57,7 +57,7 @@ Reference< XPropertySet > OUsers::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
OUserExtend* pUser = getFromUnoTunnel<OUserExtend>( descriptor );
|
||||
OUserExtend* pUser = dynamic_cast<OUserExtend*>( descriptor.get() );
|
||||
if ( pUser == nullptr )
|
||||
m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_USER_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
||||
|
||||
|
@ -42,21 +42,6 @@ OAdoView::OAdoView(bool _bCase,ADOView* _pView) : OView_ADO(_bCase,nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Sequence< sal_Int8 > OAdoView::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OAdoView::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OView_ADO>{});
|
||||
}
|
||||
|
||||
|
||||
void OAdoView::getFastPropertyValue(Any& rValue,sal_Int32 nHandle) const
|
||||
{
|
||||
if(m_aView.IsValid())
|
||||
|
@ -63,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) );
|
||||
|
||||
|
@ -608,20 +608,6 @@ void SAL_CALL OCalcTable::disposing()
|
||||
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 > & OCalcTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OCalcTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OCalcTable_BASE>{});
|
||||
}
|
||||
|
||||
bool OCalcTable::fetchRow( OValueRefRow& _rRow, const OSQLColumns & _rCols,
|
||||
bool bRetrieveData )
|
||||
{
|
||||
|
@ -104,8 +104,7 @@ Any SAL_CALL OComponentTable::queryInterface( const Type & rType )
|
||||
rType == cppu::UnoType<XDataDescriptorFactory>::get())
|
||||
return Any();
|
||||
|
||||
const Any aRet = ::cppu::queryInterface(rType,static_cast< css::lang::XUnoTunnel*> (this));
|
||||
return aRet.hasValue() ? aRet : OTable_TYPEDEF::queryInterface(rType);
|
||||
return OTable_TYPEDEF::queryInterface(rType);
|
||||
}
|
||||
|
||||
|
||||
|
@ -294,7 +294,7 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
|
||||
aRow[4] = new ORowSetValueDecorator(ORowSetValue(getBOOL(xIndex->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISUNIQUE)))));
|
||||
aRow[6] = new ORowSetValueDecorator(*pBegin);
|
||||
|
||||
auto pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xIndex);
|
||||
auto pIndex = dynamic_cast<ODbaseIndex*>(xIndex.get());
|
||||
if(pIndex)
|
||||
{
|
||||
aRow[11] = new ORowSetValueDecorator(static_cast<sal_Int32>(pIndex->getHeader().db_maxkeys));
|
||||
|
@ -99,20 +99,6 @@ void ODbaseIndex::refreshColumns()
|
||||
m_pColumns.reset(new ODbaseIndexColumns(this,m_aMutex,aVector));
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 > & ODbaseIndex::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// XUnoTunnel
|
||||
|
||||
sal_Int64 ODbaseIndex::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<ODbaseIndex_BASE>{});
|
||||
}
|
||||
|
||||
ONDXPagePtr const & ODbaseIndex::getRoot()
|
||||
{
|
||||
openIndexFile();
|
||||
|
@ -92,14 +92,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 = comphelper::getFromUnoTunnel<ODbaseIndex>(xTunnel);
|
||||
if(!pIndex)
|
||||
throw SQLException();
|
||||
ODbaseIndex* pIndex = dynamic_cast<ODbaseIndex*>(descriptor.get());
|
||||
if(pIndex)
|
||||
pIndex->CreateImpl();
|
||||
}
|
||||
|
||||
return createObject( _rForName );
|
||||
}
|
||||
@ -107,7 +102,7 @@ sdbcx::ObjectType ODbaseIndexes::appendObject( const OUString& _rForName, const
|
||||
// XDrop
|
||||
void ODbaseIndexes::dropObject(sal_Int32 _nPos, const OUString& /*_sElementName*/)
|
||||
{
|
||||
auto pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(getObject(_nPos));
|
||||
rtl::Reference<ODbaseIndex> pIndex = dynamic_cast<ODbaseIndex*>(getObject(_nPos).get());
|
||||
if ( pIndex )
|
||||
pIndex->DropImpl();
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ Sequence< sal_Int32 > SAL_CALL ODbaseResultSet::deleteRows( const Sequence< An
|
||||
|
||||
bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_xIndex)
|
||||
{
|
||||
auto pIndex = comphelper::getFromUnoTunnel<dbase::ODbaseIndex>(_xIndex);
|
||||
auto pIndex = dynamic_cast<dbase::ODbaseIndex*>(_xIndex.get());
|
||||
if(pIndex)
|
||||
{
|
||||
std::unique_ptr<dbase::OIndexIterator> pIter = pIndex->createIterator();
|
||||
|
@ -761,24 +761,10 @@ Any SAL_CALL ODbaseTable::queryInterface( const Type & rType )
|
||||
return Any();
|
||||
|
||||
Any aRet = OTable_TYPEDEF::queryInterface(rType);
|
||||
return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< css::lang::XUnoTunnel*> (this));
|
||||
return aRet;
|
||||
}
|
||||
|
||||
|
||||
const Sequence< sal_Int8 > & ODbaseTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 ODbaseTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<ODbaseTable_BASE>{});
|
||||
}
|
||||
|
||||
bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool bRetrieveData)
|
||||
{
|
||||
if (!m_pBuffer)
|
||||
@ -1597,9 +1583,7 @@ bool ODbaseTable::DeleteRow(const OSQLColumns& _rCols)
|
||||
{
|
||||
xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName;
|
||||
|
||||
Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
|
||||
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
|
||||
ODbaseIndex* pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xTunnel);
|
||||
ODbaseIndex* pIndex = dynamic_cast<ODbaseIndex*>(xIndex.get());
|
||||
assert(pIndex && "ODbaseTable::DeleteRow: No Index returned!");
|
||||
|
||||
OSQLColumns::const_iterator aIter = std::find_if(_rCols.begin(), _rCols.end(),
|
||||
@ -1703,9 +1687,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
|
||||
continue;
|
||||
else
|
||||
{
|
||||
Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
|
||||
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
|
||||
ODbaseIndex* pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xTunnel);
|
||||
ODbaseIndex* pIndex = dynamic_cast<ODbaseIndex*>(xIndex.get());
|
||||
assert(pIndex && "ODbaseTable::UpdateBuffer: No Index returned!");
|
||||
|
||||
if (pIndex->Find(0,*rRow[nPos]))
|
||||
@ -1811,9 +1793,7 @@ bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, const OValueRefRow& pOrgRo
|
||||
}
|
||||
if (aIndexedCols[i].is())
|
||||
{
|
||||
Reference<XUnoTunnel> xTunnel(aIndexedCols[i],UNO_QUERY);
|
||||
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
|
||||
ODbaseIndex* pIndex = comphelper::getFromUnoTunnel<ODbaseIndex>(xTunnel);
|
||||
ODbaseIndex* pIndex = dynamic_cast<ODbaseIndex*>(aIndexedCols[i].get());
|
||||
assert(pIndex && "ODbaseTable::UpdateBuffer: No Index returned!");
|
||||
// Update !!
|
||||
if (pOrgRow.is() && !thisColIsNull)
|
||||
|
@ -65,7 +65,7 @@ Reference< XPropertySet > ODbaseTables::createDescriptor()
|
||||
// XAppend
|
||||
sdbcx::ObjectType ODbaseTables::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
|
||||
{
|
||||
auto pTable = comphelper::getFromUnoTunnel<ODbaseTable>(descriptor);
|
||||
auto pTable = dynamic_cast<ODbaseTable*>(descriptor.get());
|
||||
if(pTable)
|
||||
{
|
||||
pTable->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME),Any(_rForName));
|
||||
@ -90,7 +90,7 @@ sdbcx::ObjectType ODbaseTables::appendObject( const OUString& _rForName, const R
|
||||
// XDrop
|
||||
void ODbaseTables::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
|
||||
{
|
||||
Reference< XUnoTunnel> xTunnel;
|
||||
Reference< XInterface > xTunnel;
|
||||
try
|
||||
{
|
||||
xTunnel.set(getObject(_nPos),UNO_QUERY);
|
||||
@ -103,7 +103,7 @@ void ODbaseTables::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
|
||||
|
||||
if ( xTunnel.is() )
|
||||
{
|
||||
ODbaseTable* pTable = comphelper::getFromUnoTunnel<ODbaseTable>(xTunnel);
|
||||
ODbaseTable* pTable = dynamic_cast<ODbaseTable*>(xTunnel.get());
|
||||
if(pTable)
|
||||
pTable->DropImpl();
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
|
||||
xNames->getByName(*pBegin), css::uno::UNO_QUERY);
|
||||
if(xTable.is())
|
||||
{
|
||||
auto pTable = comphelper::getFromUnoTunnel<OFileTable>(xTable);
|
||||
auto pTable = dynamic_cast<OFileTable*>(xTable.get());
|
||||
if(pTable && !pTable->isReadOnly())
|
||||
{
|
||||
aRow[6] = ODatabaseMetaDataResultSet::getInsertValue();
|
||||
|
@ -1528,8 +1528,7 @@ Reference< css::beans::XPropertySetInfo > SAL_CALL OResultSet::getPropertySetInf
|
||||
|
||||
void OResultSet::doTableSpecials(const OSQLTable& _xTable)
|
||||
{
|
||||
Reference<css::lang::XUnoTunnel> xTunnel(_xTable, UNO_QUERY_THROW);
|
||||
m_pTable = comphelper::getFromUnoTunnel<OFileTable>(xTunnel);
|
||||
m_pTable = dynamic_cast<OFileTable*>(_xTable.get());
|
||||
assert(m_pTable.is());
|
||||
}
|
||||
|
||||
|
@ -408,7 +408,7 @@ void OStatement_Base::construct(const OUString& sql)
|
||||
}
|
||||
|
||||
// at this moment we support only one table per select statement
|
||||
m_pTable = comphelper::getFromUnoTunnel<OFileTable>(rTabs.begin()->second);
|
||||
m_pTable = dynamic_cast<OFileTable*>(rTabs.begin()->second.get());
|
||||
OSL_ENSURE(m_pTable.is(),"No table!");
|
||||
if ( m_pTable.is() )
|
||||
m_xColNames = m_pTable->getColumns();
|
||||
|
@ -118,20 +118,6 @@ void SAL_CALL OFileTable::disposing()
|
||||
FileClose();
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 > & OFileTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit s_Id;
|
||||
return s_Id.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OFileTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OTable_TYPEDEF>{});
|
||||
}
|
||||
|
||||
void OFileTable::FileClose()
|
||||
{
|
||||
::osl::MutexGuard aGuard(m_aMutex);
|
||||
|
@ -545,24 +545,10 @@ Any SAL_CALL OFlatTable::queryInterface( const Type & rType )
|
||||
return Any();
|
||||
|
||||
Any aRet = OTable_TYPEDEF::queryInterface(rType);
|
||||
return aRet.hasValue() ? aRet : ::cppu::queryInterface(rType,static_cast< css::lang::XUnoTunnel*> (this));
|
||||
return aRet;
|
||||
}
|
||||
|
||||
|
||||
const Sequence< sal_Int8 > & OFlatTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OFlatTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OFlatTable_BASE>{});
|
||||
}
|
||||
|
||||
bool OFlatTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns & _rCols, bool bRetrieveData)
|
||||
{
|
||||
*(*_rRow)[0] = m_nFilePos;
|
||||
|
@ -115,19 +115,6 @@ sdbcx::OCollection* OHSQLTable::createIndexes(const ::std::vector< OUString>& _r
|
||||
return new OIndexesHelper(this,m_aMutex,_rNames);
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 > & OHSQLTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OHSQLTable::getSomething( const Sequence< sal_Int8 > & rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OTable_TYPEDEF>{});
|
||||
}
|
||||
|
||||
// XAlterTable
|
||||
void SAL_CALL OHSQLTable::alterColumnByName( const OUString& colName, const Reference< XPropertySet >& descriptor )
|
||||
|
@ -116,20 +116,6 @@ sdbcx::OCollection* OMySQLTable::createIndexes(const ::std::vector<OUString>& _r
|
||||
return new OIndexesHelper(this, m_aMutex, _rNames);
|
||||
}
|
||||
|
||||
const Sequence<sal_Int8>& OMySQLTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
|
||||
sal_Int64 OMySQLTable::getSomething(const Sequence<sal_Int8>& rId)
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OTable_TYPEDEF>{});
|
||||
}
|
||||
|
||||
// XAlterTable
|
||||
void SAL_CALL OMySQLTable::alterColumnByName(const OUString& colName,
|
||||
const Reference<XPropertySet>& descriptor)
|
||||
|
@ -207,18 +207,6 @@ void SAL_CALL OWriterTable::disposing()
|
||||
m_pWriterConnection = nullptr;
|
||||
}
|
||||
|
||||
const uno::Sequence<sal_Int8>& OWriterTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
sal_Int64 OWriterTable::getSomething(const uno::Sequence<sal_Int8>& rId)
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OWriterTable_BASE>{});
|
||||
}
|
||||
|
||||
bool OWriterTable::fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData)
|
||||
{
|
||||
// read the bookmark
|
||||
|
@ -44,9 +44,6 @@ namespace connectivity::ado
|
||||
OAdoColumn(bool _bCase,OConnection* _pConnection);
|
||||
// ODescriptor
|
||||
virtual void construct() override;
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
WpADOColumn getColumnImpl() const;
|
||||
};
|
||||
|
@ -45,10 +45,6 @@ namespace connectivity::ado
|
||||
OAdoGroup(OCatalog* _pParent,bool _bCase, ADOGroup* _pGroup=nullptr);
|
||||
OAdoGroup(OCatalog* _pParent,bool _bCase, const OUString& Name);
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
// XAuthorizable
|
||||
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
|
||||
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
|
||||
|
@ -38,9 +38,6 @@ namespace connectivity::ado
|
||||
public:
|
||||
OAdoIndex(bool _bCase, OConnection* _pConnection,ADOIndex* _pIndex);
|
||||
OAdoIndex(bool _bCase, OConnection* _pConnection);
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
WpADOIndex getImpl() const { return m_aIndex;}
|
||||
};
|
||||
|
@ -41,10 +41,6 @@ namespace connectivity::ado
|
||||
OAdoKey(bool _bCase,OConnection* _pConnection,ADOKey* _pKey);
|
||||
OAdoKey(bool _bCase,OConnection* _pConnection);
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
WpADOKey getImpl() const { return m_aKey;}
|
||||
// map the update/delete rules
|
||||
static RuleEnum Map2Rule(sal_Int32 _eNum);
|
||||
|
@ -53,9 +53,6 @@ namespace connectivity::ado
|
||||
virtual OUString SAL_CALL getName() override;
|
||||
OUString getSchema() const { return m_SchemaName; }
|
||||
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const override;
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
// XRename
|
||||
virtual void SAL_CALL rename( const OUString& newName ) override;
|
||||
|
@ -48,9 +48,6 @@ namespace connectivity::ado
|
||||
OAdoUser(OCatalog* _pParent,bool _bCase, ADOUser* _pUser=nullptr);
|
||||
OAdoUser(OCatalog* _pParent,bool _bCase, const OUString& Name);
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
// XUser
|
||||
virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
|
||||
// XAuthorizable
|
||||
|
@ -40,10 +40,6 @@ namespace connectivity::ado
|
||||
public:
|
||||
OAdoView(bool _bCase, ADOView* _pView=nullptr);
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
|
||||
|
||||
WpADOView getImpl() const { return m_aView;}
|
||||
};
|
||||
}
|
||||
|
@ -64,10 +64,6 @@ namespace connectivity::calc
|
||||
|
||||
virtual void SAL_CALL disposing() override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
void construct() override;
|
||||
};
|
||||
|
||||
|
@ -91,10 +91,6 @@ namespace connectivity::dbase
|
||||
void openIndexFile();
|
||||
virtual void refreshColumns() override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
const ODbaseTable* getTable() const { return m_pTable; }
|
||||
const NDXHeader& getHeader() const { return m_aHeader; }
|
||||
std::unique_ptr<OIndexIterator> createIterator();
|
||||
|
@ -161,9 +161,6 @@ namespace connectivity::dbase
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
|
||||
virtual void SAL_CALL disposing() override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
// XAlterTable
|
||||
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
|
||||
virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
|
||||
|
@ -83,10 +83,6 @@ namespace connectivity::file
|
||||
const OUString& getSchema() const { return m_SchemaName; }
|
||||
bool isReadOnly() const { return !m_bWriteable; }
|
||||
// m_pFileStream && !m_pFileStream->IsWritable(); }
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
|
||||
sal_Int32 getFilePos() const { return m_nFilePos; }
|
||||
|
||||
|
@ -92,10 +92,6 @@ namespace connectivity::flat
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
|
||||
virtual void SAL_CALL disposing() override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
OUString getEntry() const;
|
||||
};
|
||||
|
||||
|
@ -85,9 +85,6 @@ namespace connectivity::hsqldb
|
||||
|
||||
// ODescriptor
|
||||
virtual void construct() override;
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
|
||||
//XTypeProvider
|
||||
|
@ -92,9 +92,6 @@ namespace connectivity::mysql
|
||||
|
||||
// ODescriptor
|
||||
virtual void construct() override;
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
// XAlterTable
|
||||
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
|
||||
|
@ -54,10 +54,6 @@ public:
|
||||
|
||||
void SAL_CALL disposing() override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override;
|
||||
static const css::uno::Sequence<sal_Int8>& getUnoTunnelId();
|
||||
|
||||
void construct() override;
|
||||
};
|
||||
|
||||
|
@ -374,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const Reference< XPropertySet >&
|
||||
if ( !xNewlyCreated.is() )
|
||||
throw RuntimeException();
|
||||
|
||||
ODescriptor* pDescriptor = comphelper::getFromUnoTunnel<ODescriptor>( xNewlyCreated );
|
||||
ODescriptor* pDescriptor = dynamic_cast<ODescriptor*>( xNewlyCreated.get() );
|
||||
if ( pDescriptor )
|
||||
pDescriptor->setNew( false );
|
||||
|
||||
|
@ -44,12 +44,6 @@ namespace connectivity::sdbcx
|
||||
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 >& rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this);
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
struct ResetROAttribute
|
||||
@ -86,25 +80,11 @@ namespace connectivity::sdbcx
|
||||
|
||||
bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor )
|
||||
{
|
||||
ODescriptor* pImplementation = comphelper::getFromUnoTunnel<ODescriptor>( _rxDescriptor );
|
||||
ODescriptor* pImplementation = dynamic_cast<ODescriptor*>( _rxDescriptor.get() );
|
||||
return pImplementation && pImplementation->isNew();
|
||||
}
|
||||
|
||||
|
||||
const Sequence< sal_Int8 > & ODescriptor::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit implId;
|
||||
return implId.getSeq();
|
||||
}
|
||||
|
||||
|
||||
Any SAL_CALL ODescriptor::queryInterface( const Type & rType )
|
||||
{
|
||||
Any aRet = ::cppu::queryInterface(rType,static_cast< XUnoTunnel*> (this));
|
||||
return aRet.hasValue() ? aRet : ODescriptor_PBASE::queryInterface(rType);
|
||||
}
|
||||
|
||||
|
||||
void ODescriptor::setNew(bool _bNew)
|
||||
{
|
||||
m_bNew = _bNew;
|
||||
@ -115,8 +95,7 @@ namespace connectivity::sdbcx
|
||||
{
|
||||
::cppu::OTypeCollection aTypes( cppu::UnoType<XMultiPropertySet>::get(),
|
||||
cppu::UnoType<XFastPropertySet>::get(),
|
||||
cppu::UnoType<XPropertySet>::get(),
|
||||
cppu::UnoType<XUnoTunnel>::get());
|
||||
cppu::UnoType<XPropertySet>::get());
|
||||
return aTypes.getTypes();
|
||||
}
|
||||
|
||||
|
@ -309,18 +309,6 @@ void SAL_CALL ODBTable::alterColumnByName( const OUString& _rName, const Referen
|
||||
m_xColumns->refresh();
|
||||
}
|
||||
|
||||
sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId )
|
||||
{
|
||||
return comphelper::getSomethingImpl(rId, this,
|
||||
comphelper::FallbackToGetSomethingOf<OTable_Base>{});
|
||||
}
|
||||
|
||||
const Sequence< sal_Int8 > & ODBTable::getUnoTunnelId()
|
||||
{
|
||||
static const comphelper::UnoIdInit s_Id;
|
||||
return s_Id.getSeq();
|
||||
}
|
||||
|
||||
Reference< XPropertySet > ODBTable::createColumnDescriptor()
|
||||
{
|
||||
return new OTableColumnDescriptor( true );
|
||||
|
@ -128,9 +128,6 @@ namespace dbaccess
|
||||
// css::sdbcx::XAlterTable,
|
||||
virtual void SAL_CALL alterColumnByName( const OUString& _rName, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor ) override;
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
|
||||
private:
|
||||
using OTable_Base::createArrayHelper;
|
||||
using OTable_Base::getFastPropertyValue;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#define INCLUDED_CONNECTIVITY_SDBCX_VDESCRIPTOR_HXX
|
||||
|
||||
#include <comphelper/propertycontainer.hxx>
|
||||
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
||||
#include <comphelper/stl_types.hxx>
|
||||
#include <connectivity/dbtoolsdllapi.hxx>
|
||||
|
||||
@ -33,7 +32,6 @@ namespace connectivity::sdbcx
|
||||
typedef ::comphelper::OPropertyContainer ODescriptor_PBASE;
|
||||
class OOO_DLLPUBLIC_DBTOOLS ODescriptor
|
||||
:public ODescriptor_PBASE
|
||||
,public css::lang::XUnoTunnel
|
||||
{
|
||||
protected:
|
||||
OUString m_Name;
|
||||
@ -63,15 +61,9 @@ namespace connectivity::sdbcx
|
||||
|
||||
virtual void construct();
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
|
||||
/// @throws css::uno::RuntimeException
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( );
|
||||
|
||||
// css::lang::XUnoTunnel
|
||||
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
||||
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
|
||||
|
||||
// retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag
|
||||
static bool isNew( const css::uno::Reference< css::uno::XInterface >& _rxDescriptor );
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user