User: kz Date: 2007-05-10 10:34:33+0000 Log: INTEGRATION: CWS dba23a (1.68.26); FILE MERGED 2007/03/08 09:33:39 fs 1.68.26.2: #i73084# insertHierachyElement: better error handling 2007/02/26 11:48:16 fs 1.68.26.1: remove unused code Issue number: #i74804# Submitted by: [EMAIL PROTECTED] Reviewed by: [EMAIL PROTECTED]
File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/UITools.cxx?r1=1.68&r2=1.69 Delta lines: +28 -72 --------------------- --- UITools.cxx 2006-12-13 16:53:01+0000 1.68 +++ UITools.cxx 2007-05-10 10:34:31+0000 1.69 @@ -1767,47 +1767,6 @@ return xView; } // ----------------------------------------------------------------------------- -String convertURLtoUI(sal_Bool _bPrefix,ODsnTypeCollection* _pCollection,const ::rtl::OUString& _sURL) -{ - ODsnTypeCollection* pCollection = _pCollection; - if ( pCollection == NULL ) - { - static ODsnTypeCollection s_TypeCollection; - pCollection = &s_TypeCollection; - } - - String sURL( _sURL ); - DATASOURCE_TYPE eType = pCollection->getType( sURL ); - - if ( pCollection->isFileSystemBased( eType ) ) - { - // get the tow parts: prefix and file URL - String sTypePrefix, sFileURLEncoded; - if ( _bPrefix ) - { - sTypePrefix = pCollection->getDatasourcePrefix( eType ); - sFileURLEncoded = pCollection->cutPrefix( sURL ); - } - else - { - sFileURLEncoded = sURL; - } - - // substitute any variables - sFileURLEncoded = SvtPathOptions().SubstituteVariable( sFileURLEncoded ); - - // decode the URL - sURL = sTypePrefix; - if ( sFileURLEncoded.Len() ) - { - OFileNotation aFileNotation(sFileURLEncoded); - // set this decoded URL as text - sURL += String(aFileNotation.get(OFileNotation::N_SYSTEM)); - } - } - return sURL; -} -// ----------------------------------------------------------------------------- void fillTreeListNames( const Reference< XNameAccess >& _xContainer, DBTreeListBox& _rList, USHORT _nImageId, USHORT _nHighContrastImageId, SvLBoxEntry* _pParent, IContainerFoundListener* _pContainerFoundListener ) { @@ -1915,14 +1874,9 @@ throw SQLException(sError,NULL,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")) ,0,Any()); } - if ( !sNewName.getLength() ) - return sal_False; try { - Reference<XMultiServiceFactory> xORB(xNameAccess,UNO_QUERY); - OSL_ENSURE(xORB.is(),"No service factory given"); - if ( xORB.is() ) - { + Reference<XMultiServiceFactory> xORB( xNameAccess, UNO_QUERY_THROW ); Sequence< Any > aArguments(3); PropertyValue aValue; // set as folder @@ -1940,13 +1894,15 @@ ::rtl::OUString sServiceName(_bCollection ? ((_bForm) ? SERVICE_NAME_FORM_COLLECTION : SERVICE_NAME_REPORT_COLLECTION) : SERVICE_SDB_DOCUMENTDEFINITION); - Reference<XContent > xNew(xORB->createInstanceWithArguments(sServiceName,aArguments),UNO_QUERY); - Reference<XNameContainer> xNameContainer(xNameAccess,UNO_QUERY); - if ( xNameContainer.is() ) - xNameContainer->insertByName(sNewName,makeAny(xNew)); + Reference<XContent > xNew( xORB->createInstanceWithArguments( sServiceName, aArguments ), UNO_QUERY_THROW ); + Reference< XNameContainer > xNameContainer( xNameAccess, UNO_QUERY_THROW ); + xNameContainer->insertByName( sNewName, makeAny( xNew ) ); } + catch( const IllegalArgumentException& e ) + { + ::dbtools::throwGenericSQLException( e.Message, e.Context ); } - catch(Exception&) + catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); return sal_False; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
