Tag: cws_src680_hsqlcsv User: fs Date: 2008-01-17 02:57:20+0000 Modified: dba/dbaccess/source/ui/misc/UITools.cxx
Log: RESYNC: (1.68-1.75); 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.61.18.3&r2=1.61.18.4 Delta lines: +43 -92 --------------------- --- UITools.cxx 2006-12-18 08:02:33+0000 1.61.18.3 +++ UITools.cxx 2008-01-17 02:57:18+0000 1.61.18.4 @@ -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 @@ -253,9 +250,6 @@ #ifndef _DBU_MISC_HRC_ #include "dbu_misc.hrc" #endif -#ifndef _DBAUI_MODULE_DBU_HXX_ -#include "moduledbu.hxx" -#endif #ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" #endif @@ -292,9 +286,6 @@ #ifndef _NUMUNO_HXX #include <svtools/numuno.hxx> #endif -#ifndef _DBAUI_DSNTYPES_HXX_ -#include "dsntypes.hxx" -#endif #ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX #include <svtools/pathoptions.hxx> #endif @@ -1442,8 +1433,6 @@ return sName; } // ----------------------------------------------------------------------------- -namespace -{ void AppendConfigToken_Impl( ::rtl::OUString& _rURL, sal_Bool _bQuestionMark ) { // this completes a help url with the system parameters "Language" and "System" @@ -1470,6 +1459,8 @@ _rURL += SvtHelpOptions().GetSystem(); } +namespace +{ // ----------------------------------------------------------------------- sal_Bool GetHelpAnchor_Impl( const ::rtl::OUString& _rURL, ::rtl::OUString& _rAnchor ) @@ -1479,7 +1470,7 @@ try { - ::ucb::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), + ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); if ( ( aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "AnchorName" ) ) >>= sAnchor ) ) { @@ -1528,6 +1519,9 @@ // ----------------------------------------------------------------------------- void setEvalDateFormatForFormatter(Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter) { + OSL_ENSURE( _rxFormatter.is(),"setEvalDateFormatForFormatter: Formatter is NULL!"); + if ( _rxFormatter.is() ) + { Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = _rxFormatter->getNumberFormatsSupplier(); Reference< XUnoTunnel > xTunnel(xSupplier,UNO_QUERY); @@ -1539,6 +1533,7 @@ SvNumberFormatter* pFormatter = pSupplierImpl->GetNumberFormatter(); pFormatter->SetEvalDateFormat(NF_EVALDATEFORMAT_FORMAT); } + } } // ----------------------------------------------------------------------------- TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo) @@ -1737,7 +1732,7 @@ _xSourceObject->getPropertyValue(PROPERTY_COMMAND) >>= sCommand; sal_Bool bEscapeProcessing( sal_False ); - OSL_VERIFY( _xSourceObject->getPropertyValue( PROPERTY_USE_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); + OSL_VERIFY( _xSourceObject->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); if ( bEscapeProcessing ) sCommand = lcl_createSDBCLevelStatement( sCommand, _xConnection ); } @@ -1767,47 +1762,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 +1869,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 +1889,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]
