Kaydet (Commit) 7a3f0921 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1231674 Uncaught exception

and

coverity#1231675 Uncaught exception

Change-Id: If0907f2048fc5e492d5b8b49388c3bfad542e5f7
üst 209cdaa1
......@@ -425,13 +425,13 @@ Sequence< Sequence< PropertyValue > > SAL_CALL OSingleSelectQueryComposer::getSt
return getStructuredCondition(F_tmp);
}
void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, RuntimeException, std::exception)
void SAL_CALL OSingleSelectQueryComposer::appendHavingClauseByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (SQLException, WrappedTargetException, RuntimeException, std::exception)
{
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetHavingClause);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
}
void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, RuntimeException, std::exception)
void SAL_CALL OSingleSelectQueryComposer::appendFilterByColumn( const Reference< XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw(SQLException, WrappedTargetException, RuntimeException, std::exception)
{
::std::mem_fun1_t<bool,OSingleSelectQueryComposer,const OUString&> F_tmp(&OSingleSelectQueryComposer::implSetFilter);
setConditionByColumn(column,andCriteria,F_tmp,filterOperator);
......
......@@ -227,12 +227,12 @@ namespace dbaccess
virtual void SAL_CALL setElementaryQuery( const OUString& _rElementary ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setFilter( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setStructuredFilter( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendFilterByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendFilterByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendGroupByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setGroup( const OUString& group ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setHavingClause( const OUString& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setStructuredHavingClause( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& filter ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendHavingClauseByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendHavingClauseByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool andCriteria,sal_Int32 filterOperator ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL appendOrderByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool ascending ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL setOrder( const OUString& order ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
......@@ -20,11 +20,9 @@
#define __com_sun_star_sdb_XSingleSelectQueryComposer_idl__
#include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/beans/PropertyValue.idl>
#include <com/sun/star/lang/WrappedTargetException.idl>
#include <com/sun/star/sdbc/SQLException.idl>
#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.idl>
......@@ -84,7 +82,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer
if a database access error occurs.
*/
void appendFilterByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator)
raises (com::sun::star::sdbc::SQLException);
raises (com::sun::star::sdbc::SQLException, com::sun::star::lang::WrappedTargetException);
// GROUP BY
......@@ -153,7 +151,7 @@ interface XSingleSelectQueryComposer: XSingleSelectQueryAnalyzer
if a database access error occurs.
*/
void appendHavingClauseByColumn([in] com::sun::star::beans::XPropertySet column,[in] boolean andCriteria,[in] long filterOperator)
raises (com::sun::star::sdbc::SQLException);
raises (com::sun::star::sdbc::SQLException, com::sun::star::lang::WrappedTargetException);
// ORDER BY
......
......@@ -198,6 +198,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try
{
......@@ -218,6 +223,11 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try{
......@@ -228,6 +238,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try{
......@@ -239,7 +253,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){
log.println("expected Exception");
ok = ok && true;
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendFilterByColumn()", false);
}
try
{
xReSet.beforeFirst();
......@@ -388,6 +407,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
ok = ok && true;
}
catch (SQLException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
......@@ -411,9 +434,12 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
}
try{
XPropertySet dummy = null;
oObj.appendHavingClauseByColumn(dummy, true,SQLFilterOperator.EQUAL);
......@@ -423,6 +449,10 @@ public class _XSingleSelectQueryComposer extends MultiMethodTest {
} catch (SQLException e){
log.println("expected Exception");
ok = ok && true;
} catch (com.sun.star.lang.WrappedTargetException e)
{
log.println("unexpected Exception: " + e.toString());
tRes.tested("appendHavingClauseByColumn()", false);
}
// cleanup
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment