summaryrefslogtreecommitdiffstats
path: root/dbaccess/source/sdbtools
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-05-10 09:15:44 +0000
committerKurt Zenker <kz@openoffice.org>2007-05-10 09:15:44 +0000
commitbf848eb1bb1f5473cc7b3d327c8e26a80ef56f93 (patch)
tree69a8858ada3cc8886e04d5ae25f7ed520346ce53 /dbaccess/source/sdbtools
parentINTEGRATION: CWS dba23a (1.3.254); FILE MERGED (diff)
downloadcore-bf848eb1bb1f5473cc7b3d327c8e26a80ef56f93.tar.gz
core-bf848eb1bb1f5473cc7b3d327c8e26a80ef56f93.zip
INTEGRATION: CWS dba23a (1.4.74); FILE MERGED
2007/03/08 09:19:28 fs 1.4.74.1: #i73084# disallow slashes in query names, for consistency reasons
Diffstat (limited to 'dbaccess/source/sdbtools')
-rw-r--r--dbaccess/source/sdbtools/connection/objectnames.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx
index 4e6ff22bd08a..fb98bfecd1ee 100644
--- a/dbaccess/source/sdbtools/connection/objectnames.cxx
+++ b/dbaccess/source/sdbtools/connection/objectnames.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: objectnames.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 06:49:59 $
+ * last change: $Author: kz $ $Date: 2007-05-10 10:15:44 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -229,7 +229,7 @@ namespace sdbtools
{
}
- virtual bool validateName( const ::rtl::OUString& _rName )
+ inline USHORT validateName_getErrorResource( const ::rtl::OUString& _rName )
{
if ( ( _rName.indexOf( (sal_Unicode)34 ) >= 0 ) // "
|| ( _rName.indexOf( (sal_Unicode)39 ) >= 0 ) // '
@@ -238,15 +238,27 @@ namespace sdbtools
|| ( _rName.indexOf( (sal_Unicode)146 ) >= 0 ) // ’
|| ( _rName.indexOf( (sal_Unicode)180 ) >= 0 ) // ´
)
+ return STR_NO_QUOTES_IN_QUERY_NAMES;
+
+ if ( _rName.indexOf( '/') >= 0 )
+ return STR_NO_SLASHES_IN_QUERY_NAMES;
+
+ return 0;
+ }
+
+ virtual bool validateName( const ::rtl::OUString& _rName )
+ {
+ if ( validateName_getErrorResource( _rName ) != 0 )
return false;
return true;
}
virtual void validateName_throw( const ::rtl::OUString& _rName )
{
- if ( !validateName( _rName ) )
+ USHORT nErrorResource = validateName_getErrorResource( _rName );
+ if ( nErrorResource != 0 )
{
- String sError( SdbtRes( STR_NO_QUOTES_IN_QUERY_NAMES ) );
+ String sError = String( SdbtRes( nErrorResource ) );
::dbtools::throwGenericSQLException( sError, m_xConnection );
}
}