Tag: cws_src680_dba23a
User: fs      
Date: 2007/03/08 01:19:31

Modified:
   dba/dbaccess/source/sdbtools/connection/objectnames.cxx

Log:
 #i73084# disallow slashes in query names, for consistency reasons

File Changes:

Directory: /dba/dbaccess/source/sdbtools/connection/
====================================================

File [changed]: objectnames.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/sdbtools/connection/objectnames.cxx?r1=1.4&r2=1.4.74.1
Delta lines:  +18 -6
--------------------
--- objectnames.cxx     17 Sep 2006 06:49:59 -0000      1.4
+++ objectnames.cxx     8 Mar 2007 09:19:28 -0000       1.4.74.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: objectnames.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.4.74.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 06:49:59 $
+ *  last change: $Author: fs $ $Date: 2007/03/08 09:19:28 $
  *
  *  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 @@
         {
         }
 
-        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 @@
                 ||  ( _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 );
             }
         }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to