diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-11 11:06:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-25 07:19:13 +0100 |
commit | b1cfdb7bee4f7af97af54e6abbc5d04aed4ba082 (patch) | |
tree | 8211ea564e36152b9eeb7be7212342d9e82800c6 /connectivity/source/drivers/file | |
parent | Fix compilation for !HAVE_FEATURE_DBCONNECTIVITY case (diff) | |
download | core-b1cfdb7bee4f7af97af54e6abbc5d04aed4ba082.tar.gz core-b1cfdb7bee4f7af97af54e6abbc5d04aed4ba082.zip |
new loplugin:unoquery
look for places we are doing code like:
Reference<XProperty>(model, css::uno::UNO_QUERY)->getAsProperty()
which might result in a SIGSEGV is the query fails
Change-Id: I5cbdbc9e64bd0bed588297c512bf60cbacb9442e
Reviewed-on: https://gerrit.libreoffice.org/69044
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers/file')
-rw-r--r-- | connectivity/source/drivers/file/FConnection.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/file/FStatement.cxx | 6 | ||||
-rw-r--r-- | connectivity/source/drivers/file/fcomp.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index c7ca89eec114..afa6cc598668 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -179,7 +179,7 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >& } else if (aFile.isDocument()) { - Reference<XContent> xParent(Reference<XChild>(aFile.get(),UNO_QUERY)->getParent(),UNO_QUERY); + Reference<XContent> xParent(Reference<XChild>(aFile.get(),UNO_QUERY_THROW)->getParent(),UNO_QUERY_THROW); Reference<XContentIdentifier> xIdent = xParent->getIdentifier(); m_xContent = xParent; diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx index 5cd6bb8267e1..975b0d12d7a0 100644 --- a/connectivity/source/drivers/file/FStatement.cxx +++ b/connectivity/source/drivers/file/FStatement.cxx @@ -478,7 +478,7 @@ void OStatement_Base::GetAssignValues() // Create Row for the values to be set (Reference through new) if(m_aAssignValues.is()) m_aAssignValues->get().clear(); - sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount(); + sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY_THROW)->getCount(); m_aAssignValues = new OAssignValues(nCount); // unbound all std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false)); @@ -565,7 +565,7 @@ void OStatement_Base::GetAssignValues() { if(m_aAssignValues.is()) m_aAssignValues->get().clear(); - sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY)->getCount(); + sal_Int32 nCount = Reference<XIndexAccess>(m_xColNames,UNO_QUERY_THROW)->getCount(); m_aAssignValues = new OAssignValues(nCount); // unbound all std::for_each(m_aAssignValues->get().begin()+1,m_aAssignValues->get().end(),TSetRefBound(false)); @@ -642,7 +642,7 @@ void OStatement_Base::SetAssignValue(const OUString& aColumnName, { Reference<XPropertySet> xCol; m_xColNames->getByName(aColumnName) >>= xCol; - sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY)->findColumn(aColumnName); + sal_Int32 nId = Reference<XColumnLocate>(m_xColNames,UNO_QUERY_THROW)->findColumn(aColumnName); // does this column actually exist in the file? if (!xCol.is()) diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx index 63cbd0abb9b2..7de9c5fb60dc 100644 --- a/connectivity/source/drivers/file/fcomp.cxx +++ b/connectivity/source/drivers/file/fcomp.cxx @@ -439,7 +439,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo { if (m_orgColumns->getByName(aColumnName) >>= xCol) { - pOperand = OSQLAnalyzer::createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY)->findColumn(aColumnName),xCol); + pOperand = OSQLAnalyzer::createOperandAttr(Reference< XColumnLocate>(m_orgColumns,UNO_QUERY_THROW)->findColumn(aColumnName),xCol); } else {// Column doesn't exist in the Result-set |