summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 19:35:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-03 08:41:11 +0200
commitd3971ec256450e6783920b46f672048b29719949 (patch)
treef4722d0e2bc321cf71b49b7573cf38640e9b28fc /connectivity
parentf50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 (diff)
new loplugin:blockblock
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/hsqldb/HUsers.cxx16
-rw-r--r--connectivity/source/parse/sqlnode.cxx28
2 files changed, 20 insertions, 24 deletions
diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx
index 812d8edcd237..424cf0670d3d 100644
--- a/connectivity/source/drivers/hsqldb/HUsers.cxx
+++ b/connectivity/source/drivers/hsqldb/HUsers.cxx
@@ -89,16 +89,14 @@ sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Referen
// XDrop
void OUsers::dropObject(sal_Int32 /*nPos*/,const OUString& _sElementName)
{
- {
- OUString aSql( "REVOKE ALL ON * FROM " );
- OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
- aSql += ::dbtools::quoteName(aQuote,_sElementName);
+ OUString aSql( "REVOKE ALL ON * FROM " );
+ OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
+ aSql += ::dbtools::quoteName(aQuote,_sElementName);
- Reference< XStatement > xStmt = m_xConnection->createStatement( );
- if(xStmt.is())
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
- }
+ Reference< XStatement > xStmt = m_xConnection->createStatement( );
+ if(xStmt.is())
+ xStmt->execute(aSql);
+ ::comphelper::disposeComponent(xStmt);
}
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index b7464836e90b..b5a32548af1f 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1463,25 +1463,23 @@ OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >&
OSQLParser::~OSQLParser()
{
+ ::osl::MutexGuard aGuard(getMutex());
+ OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
+ if (!--s_nRefCount)
{
- ::osl::MutexGuard aGuard(getMutex());
- OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
- if (!--s_nRefCount)
- {
- s_pScanner->setScanner(true);
- delete s_pScanner;
- s_pScanner = nullptr;
+ s_pScanner->setScanner(true);
+ delete s_pScanner;
+ s_pScanner = nullptr;
- delete s_pGarbageCollector;
- s_pGarbageCollector = nullptr;
- // Is only set the first time, so we should delete it only when there are no more instances
- s_xLocaleData = nullptr;
+ delete s_pGarbageCollector;
+ s_pGarbageCollector = nullptr;
+ // Is only set the first time, so we should delete it only when there are no more instances
+ s_xLocaleData = nullptr;
- RuleIDMap aEmpty;
- s_aReverseRuleIDLookup.swap( aEmpty );
- }
- m_pParseTree = nullptr;
+ RuleIDMap aEmpty;
+ s_aReverseRuleIDLookup.swap( aEmpty );
}
+ m_pParseTree = nullptr;
}
void OSQLParseNode::substituteParameterNames(OSQLParseNode const * _pNode)