diff options
Diffstat (limited to 'connectivity/source/commontools/TIndexes.cxx')
-rw-r--r-- | connectivity/source/commontools/TIndexes.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx index 5a8c7c29a0f4..5973806f1257 100644 --- a/connectivity/source/commontools/TIndexes.cxx +++ b/connectivity/source/commontools/TIndexes.cxx @@ -37,7 +37,6 @@ 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; using namespace cppu; @@ -51,13 +50,13 @@ OIndexesHelper::OIndexesHelper(OTableHelper* _pTable, } -sdbcx::ObjectType OIndexesHelper::createObject(const OUString& _rName) +css::uno::Reference< css::beans::XPropertySet > OIndexesHelper::createObject(const OUString& _rName) { Reference< XConnection> xConnection = m_pTable->getConnection(); if ( !xConnection.is() ) return nullptr; - sdbcx::ObjectType xRet; + rtl::Reference< OIndexHelper > xRet; OUString aName,aQualifier; sal_Int32 nLen = _rName.indexOf('.'); if ( nLen != -1 ) @@ -101,10 +100,9 @@ sdbcx::ObjectType OIndexesHelper::createObject(const OUString& _rName) catch(const Exception&) { } - OIndexHelper* pRet = new OIndexHelper(m_pTable,aName,aQualifier,bUnique, + xRet = new OIndexHelper(m_pTable,aName,aQualifier,bUnique, bPrimarKeyIndex, nClustered == IndexType::CLUSTERED); - xRet = pRet; break; } } @@ -124,7 +122,7 @@ Reference< XPropertySet > OIndexesHelper::createDescriptor() } // XAppend -sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) +css::uno::Reference< css::beans::XPropertySet > OIndexesHelper::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor ) { Reference< XConnection> xConnection = m_pTable->getConnection(); if ( !xConnection.is() ) @@ -153,10 +151,10 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const OUString aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable, true, ::dbtools::EComposeRule::InIndexDefinitions); if (!_rForName.isEmpty() ) { - aSql.append( ::dbtools::quoteName( aQuote, _rForName ) ); - aSql.append(" ON "); - aSql.append(aComposedName); - aSql.append(" ( "); + aSql.append( ::dbtools::quoteName( aQuote, _rForName ) + + " ON " + + aComposedName + + " ( "); Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY); Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY); @@ -193,8 +191,8 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const OUString& _rForName, const xColumns->getByIndex(0) >>= xColProp; - aSql.append("."); - aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); + aSql.append("." + + ::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))); } Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( ); @@ -228,7 +226,7 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementNam aSchema = _sElementName.copy(0,nLen); aName = _sElementName.copy(nLen+1); - OUString aSql( "DROP INDEX " ); + OUString aSql( u"DROP INDEX "_ustr ); OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::EComposeRule::InIndexDefinitions, true ); OUString sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), OUString(), aSchema, aName, true, ::dbtools::EComposeRule::InIndexDefinitions ); |