From 4c945b22fc42eb7a52864018cbca88358e71fd4d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 21 Sep 2018 14:26:56 +0200 Subject: new loplugin:methodcycles look for closed cycles of methods i.e. unused code that would not otherwise be found by the unusedmethods loplugin Change-Id: I3fb052132d97aabca573bb8e9fc424201b1e2042 Reviewed-on: https://gerrit.libreoffice.org/60875 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/parse/sqliterator.cxx | 67 ------------------------------- 1 file changed, 67 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 5ba5c11325be..dcca0fc9db4a 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -780,73 +780,6 @@ void OSQLParseTreeIterator::getColumnRange( const OSQLParseNode* _pColumnRef, } -bool OSQLParseTreeIterator::getColumnTableRange(const OSQLParseNode* pNode, OUString &rTableRange) const -{ - OUString tmp; - if(impl_getColumnTableRange(pNode, tmp)) - { - rTableRange = tmp; - return true; - } - else - return false; -} - -bool OSQLParseTreeIterator::impl_getColumnTableRange(const OSQLParseNode* pNode, OUString &rTableRange) const -{ - // See if all columns belong to one table - if (SQL_ISRULE(pNode,column_ref)) - { - OUString aColName, aTableRange; - getColumnRange(pNode, aColName, aTableRange); - if (aTableRange.isEmpty()) // None found - { - // Look for the columns in the tables - for (auto const& table : *m_pImpl->m_pTables) - { - if (table.second.is()) - { - try - { - Reference< XNameAccess > xColumns = table.second->getColumns(); - if(xColumns->hasByName(aColName)) - { - Reference< XPropertySet > xColumn; - if (xColumns->getByName(aColName) >>= xColumn) - { - OSL_ENSURE(xColumn.is(),"Column isn't a propertyset!"); - aTableRange = table.first; - break; - } - } - } - catch(Exception&) - { - } - } - } - if (aTableRange.isEmpty()) - return false; - } - - - if (rTableRange.isEmpty()) - rTableRange = aTableRange; - else if (rTableRange != aTableRange) - return false; - } - else - { - for (sal_uInt32 i = 0, ncount = pNode->count(); i < ncount; i++) - { - if (!getColumnTableRange(pNode->getChild(i), rTableRange)) - return false; - } - } - return true; -} - - void OSQLParseTreeIterator::traverseCreateColumns(const OSQLParseNode* pSelectNode) { // aIteratorStatus.Clear(); -- cgit