Tag: cws_src680_dba23a
User: fs      
Date: 2007/03/08 01:08:57

Modified:
   dba/dbaccess/source/core/dataaccess/definitioncontainer.cxx

Log:
 #i73084# approveObject: don't allow slashes in the name

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: definitioncontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/definitioncontainer.cxx?r1=1.23&r2=1.23.74.1
Delta lines:  +18 -17
---------------------
--- definitioncontainer.cxx     17 Sep 2006 06:39:55 -0000      1.23
+++ definitioncontainer.cxx     8 Mar 2007 09:08:54 -0000       1.23.74.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: definitioncontainer.cxx,v $
  *
- *  $Revision: 1.23 $
+ *  $Revision: 1.23.74.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 06:39:55 $
+ *  last change: $Author: fs $ $Date: 2007/03/08 09:08:54 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -639,38 +639,39 @@
        // check the arguments
        if ( !_sName.getLength() )
         throw IllegalArgumentException(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The name must not 
be empty." ) ),
+            DBA_RES( RID_STR_NAME_MUST_NOT_BE_EMPTY ),
+            *this,
+            0 );
+
+    if ( _sName.indexOf( '/' ) != -1 )
+        throw IllegalArgumentException(
+            DBA_RES( RID_STR_NO_SLASH_IN_OBJECT_NAME ),
             *this,
             0 );
-        // TODO: resource
 
        if ( !_rxObject.is() )
         throw IllegalArgumentException(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The container 
cannot contain NULL objects." ) ),
+            DBA_RES( RID_STR_NO_NULL_OBJECTS_IN_CONTAINER ),
             *this,
             0 );
-        // TODO: resource
 
        const ODefinitionContainer_Impl& rDefinitions( getDefinitions() );
     if ( rDefinitions.find( _sName ) != rDefinitions.end() )
         throw ElementExistException(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "There already is an 
object with the given name." ) ),
+            DBA_RES( RID_STR_NAME_ALREADY_USED ),
             *this );
-        // TODO: resource
 
     ::rtl::Reference< OContentHelper > pContent( 
OContentHelper::getImplementation( _rxObject ) );
     if ( !pContent.is() )
         throw IllegalArgumentException(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "This object cannot 
be part of this container." ) ),
+            DBA_RES( RID_STR_OBJECT_CONTAINER_MISMATCH ),
             *this,
             1 );
-        // TODO: resource
 
     if ( rDefinitions.find( pContent->getImpl() ) != rDefinitions.end() )
         throw ElementExistException(
-            ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The object is 
already part of the container - under a different name." ) ),
+            DBA_RES( RID_STR_OBJECT_ALREADY_CONTAINED ),
             *this );
-        // TODO: resource
 }
 
 // 
-----------------------------------------------------------------------------




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

Reply via email to