From 42165189826367937737861116e969a22e9db787 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Wed, 11 Sep 2013 21:40:41 +0100 Subject: Update implementations of ColumnLocate::findColumn to throw on invalid column. Change-Id: I7a9354ecd35a70a005c6c50e38d27de9b33332bd Reviewed-on: https://gerrit.libreoffice.org/5922 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- connectivity/source/drivers/macab/MacabResultSet.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'connectivity/source/drivers/macab') diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx index 7a743742c733..c9f866e6b992 100644 --- a/connectivity/source/drivers/macab/MacabResultSet.cxx +++ b/connectivity/source/drivers/macab/MacabResultSet.cxx @@ -185,20 +185,16 @@ sal_Int32 SAL_CALL MacabResultSet::findColumn(const OUString& columnName) throw( sal_Int32 nLen = xMeta->getColumnCount(); for (sal_Int32 i = 1; i <= nLen; ++i) + { if (xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))) return i; + } - ::connectivity::SharedResources aResources; - const OUString sError( aResources.getResourceStringWithSubstitution( - STR_NO_ELEMENT_NAME, - "$name$", columnName - ) ); - ::dbtools::throwGenericSQLException(sError , *this); - // Unreachable: - OSL_ASSERT(false); - return 0; + ::dbtools::throwInvalidColumnException( columnName, *this ); + assert(false); + return 0; // Never reached } // ------------------------------------------------------------------------- OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException) -- cgit