diff options
Diffstat (limited to 'connectivity/source/drivers/mysql_jdbc/YTables.cxx')
-rw-r--r-- | connectivity/source/drivers/mysql_jdbc/YTables.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/connectivity/source/drivers/mysql_jdbc/YTables.cxx b/connectivity/source/drivers/mysql_jdbc/YTables.cxx index e21e05fb2914..b333db670623 100644 --- a/connectivity/source/drivers/mysql_jdbc/YTables.cxx +++ b/connectivity/source/drivers/mysql_jdbc/YTables.cxx @@ -37,26 +37,24 @@ 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 dbtools; -sdbcx::ObjectType OTables::createObject(const OUString& _rName) +css::uno::Reference<css::beans::XPropertySet> OTables::createObject(const OUString& _rName) { OUString sCatalog, sSchema, sTable; ::dbtools::qualifiedNameComponents(m_xMetaData, _rName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation); - Sequence<OUString> sTableTypes(3); - sTableTypes[0] = "VIEW"; - sTableTypes[1] = "TABLE"; - sTableTypes[2] = "%"; // just to be sure to include anything else... + Sequence<OUString> sTableTypes{ + u"VIEW"_ustr, u"TABLE"_ustr, u"%"_ustr + }; // this last one just to be sure to include anything else... Any aCatalog; if (!sCatalog.isEmpty()) aCatalog <<= sCatalog; Reference<XResultSet> xResult = m_xMetaData->getTables(aCatalog, sSchema, sTable, sTableTypes); - sdbcx::ObjectType xRet; + rtl::Reference<OMySQLTable> xRet; if (xResult.is()) { Reference<XRow> xRow(xResult, UNO_QUERY); @@ -67,10 +65,9 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName) | Privilege::UPDATE | Privilege::INSERT | Privilege::SELECT; - OMySQLTable* pRet = new OMySQLTable( - this, static_cast<OMySQLCatalog&>(m_rParent).getConnection(), sTable, - xRow->getString(4), xRow->getString(5), sSchema, sCatalog, nPrivileges); - xRet = pRet; + xRet = new OMySQLTable(this, static_cast<OMySQLCatalog&>(m_rParent).getConnection(), + sTable, xRow->getString(4), xRow->getString(5), sSchema, + sCatalog, nPrivileges); } ::comphelper::disposeComponent(xResult); } @@ -92,8 +89,8 @@ Reference<XPropertySet> OTables::createDescriptor() } // XAppend -sdbcx::ObjectType OTables::appendObject(const OUString& _rForName, - const Reference<XPropertySet>& descriptor) +css::uno::Reference<css::beans::XPropertySet> +OTables::appendObject(const OUString& _rForName, const Reference<XPropertySet>& descriptor) { createTable(descriptor); return createObject(_rForName); @@ -113,7 +110,7 @@ void OTables::dropObject(sal_Int32 _nPos, const OUString& _sElementName) ::dbtools::qualifiedNameComponents(m_xMetaData, _sElementName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation); - OUString aSql("DROP "); + OUString aSql(u"DROP "_ustr); Reference<XPropertySet> xProp(xObject, UNO_QUERY); bool bIsView = xProp.is() @@ -155,7 +152,7 @@ OUString OTables::adjustSQL(const OUString& _sSql) sal_Int32 nPos = nIndex + strlen(s_sUNSIGNED); OUString sNewUnsigned(sSQL.copy(nPos, nParen - nPos + 1)); sSQL = sSQL.replaceAt(nIndex, strlen(s_sUNSIGNED) + sNewUnsigned.getLength(), - sNewUnsigned + s_sUNSIGNED); + rtl::Concat2View(sNewUnsigned + s_sUNSIGNED)); nIndex = sSQL.indexOf(s_sUNSIGNED, nIndex + strlen(s_sUNSIGNED) + sNewUnsigned.getLength()); } return sSQL; @@ -180,13 +177,13 @@ void OTables::appendNew(const OUString& _rsNewTable) insertElement(_rsNewTable, nullptr); // notify our container listeners - ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rsNewTable), Any(), Any()); - OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners); + ContainerEvent aEvent(static_cast<XContainer*>(this), Any(_rsNewTable), Any(), Any()); + OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners); while (aListenerLoop.hasMoreElements()) - static_cast<XContainerListener*>(aListenerLoop.next())->elementInserted(aEvent); + aListenerLoop.next()->elementInserted(aEvent); } -OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject) +OUString OTables::getNameForObject(const css::uno::Reference<css::beans::XPropertySet>& _xObject) { OSL_ENSURE(_xObject.is(), "OTables::getNameForObject: Object is NULL!"); return ::dbtools::composeTableName(m_xMetaData, _xObject, |