Tag: cws_src680_bgdlremove User: kso Date: 2007-05-21 10:46:50+0000 Log: RESYNC: (1.68-1.70); FILE MERGED
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.52.1&r2=1.68.52.2 Delta lines: +30 -77 --------------------- --- UITools.cxx 2007-05-18 09:03:14+0000 1.68.52.1 +++ UITools.cxx 2007-05-21 10:46:47+0000 1.68.52.2 @@ -229,9 +229,6 @@ #ifndef _SVX_NUMINF_HXX #include <svx/numinf.hxx> #endif -#ifndef _EEITEMID_HXX -#include <svx/eeitemid.hxx> -#endif #ifndef _ZFORLIST_HXX #include <svtools/zforlist.hxx> #endif @@ -1767,47 +1764,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 +1871,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 +1891,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]
