User: vg Date: 05/03/10 07:19:11 Modified: /dba/connectivity/source/drivers/adabas/ BColumns.cxx
Log: INTEGRATION: CWS dba24 (1.15.262); FILE MERGED 2005/02/09 08:07:36 oj 1.15.262.1: #i26950# remove the need for XNamed File Changes: Directory: /dba/connectivity/source/drivers/adabas/ =================================================== File [changed]: BColumns.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/adabas/BColumns.cxx?r1=1.15&r2=1.16 Delta lines: +15 -19 --------------------- --- BColumns.cxx 12 Oct 2001 11:39:41 -0000 1.15 +++ BColumns.cxx 10 Mar 2005 15:19:08 -0000 1.16 @@ -113,12 +113,12 @@ using namespace ::com::sun::star::lang; typedef connectivity::sdbcx::OCollection OCollection_TYPE; -Reference< XNamed > OColumns::createObject(const ::rtl::OUString& _rName) +sdbcx::ObjectType OColumns::createObject(const ::rtl::OUString& _rName) { Reference< XResultSet > xResult = m_pTable->getConnection()->getMetaData()->getColumns(Any(), m_pTable->getSchema(),m_pTable->getTableName(),_rName); - Reference< XNamed > xRet = NULL; + sdbcx::ObjectType xRet = NULL; if(xResult.is()) { Reference< XRow > xRow(xResult,UNO_QUERY); @@ -131,7 +131,7 @@ sal_Int32 nPrec = xRow->getInt(7); OAdabasCatalog::correctColumnProperties(nPrec,nType,sTypeName); - OColumn* pRet = new OColumn(_rName, + xRet = new OColumn(_rName, sTypeName, xRow->getString(13), xRow->getInt(11), @@ -139,7 +139,6 @@ xRow->getInt(9), nType, sal_False,sal_False,sal_False,sal_True); - xRet = pRet; break; } } @@ -160,14 +159,11 @@ return new OColumn(sal_True); } // ----------------------------------------------------------------------------- -Reference< XNamed > OColumns::cloneObject(const Reference< XPropertySet >& _xDescriptor) +sdbcx::ObjectType OColumns::cloneObject(const Reference< XPropertySet >& _xDescriptor) { - OColumn* pColumn = new OColumn(sal_True); - Reference<XPropertySet> xProp = pColumn; + sdbcx::ObjectType xProp = new OColumn(sal_True); ::comphelper::copyProperties(_xDescriptor,xProp); - Reference< XNamed > xName(xProp,UNO_QUERY); - OSL_ENSURE(xName.is(),"Must be a XName interface here !"); - return xName; + return xProp; } // ------------------------------------------------------------------------- // XAppend @@ -179,7 +175,7 @@ if(descriptor.is() && !m_pTable->isNew()) { - ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("ALTER TABLE "); + ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE ")); ::rtl::OUString sQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); const ::rtl::OUString& sDot = OAdabasCatalog::getDot(); @@ -189,11 +185,11 @@ ::rtl::OUString sColumnName; descriptor->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sColumnName; aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName()); - aSql += ::rtl::OUString::createFromAscii(" ADD ("); + aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD (")); aSql += ::dbtools::quoteName(sQuote,sColumnName); - aSql += ::rtl::OUString::createFromAscii(" "); + aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); aSql += OTables::getColumnSqlType(descriptor); - aSql += ::rtl::OUString::createFromAscii(" )"); + aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" )")); Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement(); xStmt->execute(aSql); @@ -216,12 +212,12 @@ OSL_ENSURE(m_pTable,"OColumns::dropByName: Table is null!"); if(!m_pTable->isNew()) { - ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("ALTER TABLE "); + ::rtl::OUString aSql(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE ")); ::rtl::OUString sQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( ); const ::rtl::OUString& sDot = OAdabasCatalog::getDot(); aSql += ::dbtools::quoteName(sQuote,m_pTable->getSchema()) + sDot + ::dbtools::quoteName(sQuote,m_pTable->getTableName()); - aSql += ::rtl::OUString::createFromAscii(" DROP "); + aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP ")); aSql += ::dbtools::quoteName(sQuote,_sElementName); Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
