Tag: cws_src680_qiq User: fs Date: 06/05/24 02:11:54 Modified: /dba/dbaccess/source/core/dataaccess/ documentcontainer.cxx, documentcontainer.hxx
Log: #i51143# more detailed error messages during approveNewObject File Changes: Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentcontainer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.17&r2=1.17.52.1 Delta lines: +11 -5 -------------------- --- documentcontainer.cxx 31 Jan 2006 18:40:22 -0000 1.17 +++ documentcontainer.cxx 24 May 2006 09:11:50 -0000 1.17.52.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentcontainer.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.17.52.1 $ * - * last change: $Author: kz $ $Date: 2006/01/31 18:40:22 $ + * last change: $Author: fs $ $Date: 2006/05/24 09:11:50 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -652,9 +652,15 @@ : Reference< XStorage>(); } // ----------------------------------------------------------------------------- -sal_Bool ODocumentContainer::approveNewObject(const ::rtl::OUString& _sName,const Reference< XContent >& _rxObject) const +void ODocumentContainer::approveNewObject(const ::rtl::OUString& _sName,const Reference< XContent >& _rxObject) const { - return (_sName.indexOf('/',0) == -1) && ODefinitionContainer::approveNewObject(_sName,_rxObject); + ODefinitionContainer::approveNewObject( _sName, _rxObject ); + + if ( _sName.indexOf( '/' ) != -1 ) + throw IllegalArgumentException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The name must not contain any / characters." ) ), + *this, + 0 ); } // ----------------------------------------------------------------------------- void SAL_CALL ODocumentContainer::removeByName( const ::rtl::OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException) File [changed]: documentcontainer.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.hxx?r1=1.8&r2=1.8.122.1 Delta lines: +11 -13 --------------------- --- documentcontainer.hxx 8 Sep 2005 13:29:51 -0000 1.8 +++ documentcontainer.hxx 24 May 2006 09:11:51 -0000 1.8.122.1 @@ -4,9 +4,9 @@ * * $RCSfile: documentcontainer.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.8.122.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 13:29:51 $ + * last change: $Author: fs $ $Date: 2006/05/24 09:11:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -65,7 +65,7 @@ namespace dbaccess { //........................................................................ -typedef ::cppu::ImplHelper4< ::com::sun::star::frame::XComponentLoader +typedef ::cppu::ImplHelper4 < ::com::sun::star::frame::XComponentLoader , ::com::sun::star::lang::XMultiServiceFactory , ::com::sun::star::container::XHierarchicalNameContainer , ::com::sun::star::embed::XTransactedObject @@ -148,10 +148,8 @@ // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; - /** approve that the object given may be inserted into the container. Should be overloaded by derived classes, - the default implementation just checks the object to be non-void. - */ - virtual sal_Bool approveNewObject(const ::rtl::OUString& _sName,const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent >& _rxObject) const; + // ODefinitionContainer + virtual void approveNewObject(const ::rtl::OUString& _sName,const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent >& _rxObject) const; }; //........................................................................ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
