diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 12:28:29 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 12:28:29 +0000 |
commit | 0e779477f3218d8b1325eb3e62470f7380c2546c (patch) | |
tree | 49f07432f8f482fcc5bc659fdddd8101f15d0a1d /connectivity/source/drivers/evoab2 | |
parent | 71faa9e9fd955a238d3060a7f9b64818091a8573 (diff) |
CWS-TOOLING: integrate CWS dba31b
Diffstat (limited to 'connectivity/source/drivers/evoab2')
-rw-r--r-- | connectivity/source/drivers/evoab2/NDriver.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 11 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSetMetaData.cxx | 14 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NStatement.cxx | 38 |
4 files changed, 35 insertions, 40 deletions
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx index df8ef37ac4..961a1cf6a3 100644 --- a/connectivity/source/drivers/evoab2/NDriver.cxx +++ b/connectivity/source/drivers/evoab2/NDriver.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: NDriver.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.56.1 $ * * This file is part of OpenOffice.org. * @@ -46,6 +46,9 @@ #include <tools/debug.hxx> #include "NDebug.hxx" #include <signal.h> +#include "resource/common_res.hrc" +#include "resource/sharedresources.hxx" + using namespace osl; using namespace connectivity::evoab; //using namespace connectivity::file; @@ -162,7 +165,12 @@ sal_Bool SAL_CALL OEvoabDriver::acceptsURL( const ::rtl::OUString& url ) Sequence< DriverPropertyInfo > SAL_CALL OEvoabDriver::getPropertyInfo( const ::rtl::OUString& url, const Sequence< PropertyValue >& /*info*/ ) throw(SQLException, RuntimeException) { if ( ! acceptsURL(url) ) - ::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid URL!")) ,*this); + { + ::connectivity::SharedResources aResources; + const ::rtl::OUString sMessage = aResources.getResourceString(STR_URI_SYNTAX_ERROR); + ::dbtools::throwGenericSQLException(sMessage ,*this); + } // if ( ! acceptsURL(url) ) + // if you have somthing special to say return it here :-) return Sequence< DriverPropertyInfo >(); } diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index 634b78ce98..685d24a40f 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: NResultSet.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.56.1 $ * * This file is part of OpenOffice.org. * @@ -40,9 +40,7 @@ #include <com/sun/star/sdbc/ResultSetConcurrency.hpp> #include <comphelper/types.hxx> #include <connectivity/dbexception.hxx> -#ifndef _CONNECTIVITY_TSORTINDEX_HXX_ #include <TSortIndex.hxx> -#endif #include <rtl/string.hxx> #include <vector> #include <algorithm> @@ -53,9 +51,8 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include "propertyids.hxx" -#ifndef _SVTOOLS_LOGINDLG_HXX #include <svtools/logindlg.hxx> -#endif +#include "resource/evoab2_res.hrc" using namespace ::comphelper; using namespace connectivity; @@ -225,9 +222,7 @@ void OEvoabResultSet::construct( EBookQuery *pQuery, rtl::OString aTable, bool b if( bIsWithoutWhere && !isLocal( pBook ) ) { OSL_TRACE( "large query on non-local book - ignored" ); - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( - "Use SQL Query with \"where clause\" or \"criteria\", to get the results." ), NULL ); + m_pConnection->throwGenericSQLException(STR_USE_WHERE_CRIT,*this); } else { diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx index 80b4e90997..2dd6a53d87 100644 --- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: NResultSetMetaData.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.7.56.2 $ * * This file is part of OpenOffice.org. * @@ -35,6 +35,7 @@ #include "connectivity/dbexception.hxx" #include <com/sun/star/sdbc/DataType.hpp> #include "NDebug.hxx" +#include "resource/evoab2_res.hrc" using namespace connectivity::evoab; using namespace com::sun::star::uno; @@ -64,9 +65,14 @@ void OEvoabResultSetMetaData::setEvoabFields(const ::vos::ORef<connectivity::OSQ (*aIter)->getPropertyValue(aName) >>= aFieldName; guint nFieldNumber = findEvoabField(aFieldName); if (nFieldNumber == (guint)-1) - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii("Invalid column name: ") + aFieldName, - NULL); + { + :.connectivity::SharedResource aResource; + const ::rtl::OUString sError( aResource.getResourceStringWithSubstitution( + STR_INVALID_COLUMNNAME, + "$columnname$", aFieldName + ) ); + ::dbtools::throwGenericSQLException( sError, *this ); + } m_aEvoabFields.push_back(nFieldNumber); } } diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx index 473c4f9d84..6a37650657 100644 --- a/connectivity/source/drivers/evoab2/NStatement.cxx +++ b/connectivity/source/drivers/evoab2/NStatement.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: NStatement.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.2.1 $ * * This file is part of OpenOffice.org. * @@ -262,13 +262,10 @@ EBookQuery *OStatement_Base::whereAnalysis( const OSQLParseNode* parseTree ) thr // odbc date (SQL_ISRULE( parseTree->getChild( 2 ), set_fct_spec ) && SQL_ISPUNCTUATION( parseTree->getChild( 2 )->getChild( 0 ), "{" ) ) ) ) - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "Query too complex" ), NULL); + getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this); - if (pPrec->getNodeType() != SQL_NODE_EQUAL && - pPrec->getNodeType() != SQL_NODE_NOTEQUAL) - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "Operator too complex" ), NULL); + if (pPrec->getNodeType() != SQL_NODE_EQUAL && pPrec->getNodeType() != SQL_NODE_NOTEQUAL) + getConnection()->throwGenericSQLException(STR_OPERATOR_TOO_COMPLEX,*this); rtl::OUString aMatchString; rtl::OUString aColumnName; @@ -302,8 +299,7 @@ EBookQuery *OStatement_Base::whereAnalysis( const OSQLParseNode* parseTree ) thr } if( ! SQL_ISRULE( parseTree->getChild( 0 ), column_ref) ) - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "Invalid Statement - Not a Column"), NULL ); + getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_COLUMN,*this); OSQLParseNode *pColumn = parseTree->getChild( 0 ); // Match Item OSQLParseNode *pAtom = parseTree->getChild( parseTree->count() - 2 ); // Match String @@ -316,8 +312,7 @@ EBookQuery *OStatement_Base::whereAnalysis( const OSQLParseNode* parseTree ) thr ( pAtom->getChild( 0 ) && pAtom->getChild( 0 )->getNodeType() == SQL_NODE_STRING ) ) ) { OSL_TRACE( "analyseSQL : pAtom->count() = %d\n", pAtom->count() ); - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "Invalid Statement - Not a String" ), NULL ); + getConnection()->throwGenericSQLException(STR_QUERY_INVALID_LIKE_STRING,*this); } const sal_Unicode WILDCARD = '%'; @@ -347,21 +342,16 @@ EBookQuery *OStatement_Base::whereAnalysis( const OSQLParseNode* parseTree ) thr else if( bNotLike ) { // We currently can't handle a 'NOT LIKE' when there are '%' - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "not like statement too complex" ), NULL ); + getConnection()->throwGenericSQLException(STR_QUERY_NOT_LIKE_TOO_COMPLEX,*this); } else if( (aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) ) ) { // One occurance of '%' matches... if ( aMatchString.indexOf ( WILDCARD ) == 0 ) pResult = createTest( aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.copy( 1 ) ); - else if ( aMatchString.indexOf ( WILDCARD ) == aMatchString.getLength() - 1 ) pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.copy( 0, aMatchString.getLength() - 1 ) ); - else - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "like statement contains wildcard in the middle" ), NULL ); - + getConnection()->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD,*this); if( pResult && bNotLike ) pResult = e_book_query_not( pResult, TRUE ); @@ -373,11 +363,10 @@ EBookQuery *OStatement_Base::whereAnalysis( const OSQLParseNode* parseTree ) thr pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.copy (1, aMatchString.getLength() - 2) ); } else - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii( "like statement contains too many wildcards" ), NULL ); + getConnection()->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD_MANY,*this); } else - OSL_ASSERT( "Serious internal error" ); + OSL_ASSERT( "Serious internal error" ); } return pResult; @@ -473,11 +462,8 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUS e_book_query_unref( pQuery ); xColumns = m_aSQLIterator.getSelectColumns(); if (!xColumns.isValid()) - { - ::dbtools::throwGenericSQLException( - ::rtl::OUString::createFromAscii("Invalid selection of columns"), - NULL); - } + getConnection()->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this); + OEvoabResultSetMetaData *pMeta = (OEvoabResultSetMetaData *) pResult->getMetaData().get(); pMeta->setEvoabFields(xColumns); } |