Tag: cws_dev300_rptchart02 User: oj Date: 2008-06-11 12:40:42+0000 Removed: dba/dbaccess/source/core/api/CKey.cxx dba/dbaccess/source/core/api/CKey.hxx dba/dbaccess/source/core/api/CKeyColumn.hxx dba/dbaccess/source/core/api/CKeyColumns.cxx dba/dbaccess/source/core/api/CKeyColumns.hxx dba/dbaccess/source/core/api/CKeys.cxx dba/dbaccess/source/core/api/CKeys.hxx dba/dbaccess/util/defs/wntmsci12
Modified: dba/dbaccess/source/core/api/RowSet.cxx dba/dbaccess/source/core/api/RowSetCache.cxx dba/dbaccess/source/core/dataaccess/databasedocument.cxx dba/dbaccess/source/core/dataaccess/documentdefinition.cxx dba/dbaccess/source/ui/app/AppController.cxx dba/dbaccess/source/ui/browser/dbloader.cxx dba/dbaccess/source/ui/browser/genericcontroller.cxx dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx Log: RESYNC:; FILE REMOVED File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKey.cxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKey.hxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKeyColumn.hxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKeyColumns.cxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKeyColumns.hxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKeys.cxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [removed]: CKeys.hxx Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.155.30.2&r2=1.155.30.3 Delta lines: +3 -0 ------------------- --- RowSet.cxx 2008-04-16 06:46:22+0000 1.155.30.2 +++ RowSet.cxx 2008-06-11 12:39:47+0000 1.155.30.3 @@ -2699,6 +2699,9 @@ // TODO: resource if ( m_aCurrentRow.isNull() ) throwSQLException( "Invalid cursor state", SQL_INVALID_CURSOR_STATE, *this ); + + if ( sal_Int32((*m_aCurrentRow)->size()) <= columnIndex ) + throwSQLException( "Invalid column index", SQL_INVALID_DESCRIPTOR_INDEX, *this ); // TODO: resource if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) throwSQLException( "Result set is not writeable", SQL_GENERAL_ERROR, *this ); Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSetCache.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetCache.cxx?r1=1.97.6.2&r2=1.97.6.3 Delta lines: +9 -8 ------------------- --- RowSetCache.cxx 2008-05-23 08:36:37+0000 1.97.6.2 +++ RowSetCache.cxx 2008-06-11 12:39:52+0000 1.97.6.3 @@ -164,6 +164,7 @@ sal_Bool bAllKeysFound = sal_False; sal_Int32 nTablesCount = 0; + Reference< XIndexAccess> xUpdateTableKeys; ::rtl::OUString aUpdateTableName = _rUpdateTableName; Reference< XConnection> xConnection; if(_xAnalyzer.is()) @@ -193,15 +194,15 @@ Reference<XKeysSupplier> xKeys(m_aUpdateTable,UNO_QUERY); if(xKeys.is()) { - Reference< XIndexAccess> xKeyIndex = xKeys->getKeys(); - if ( xKeyIndex.is() ) + xUpdateTableKeys = xKeys->getKeys(); + if ( xUpdateTableKeys.is() ) { Reference<XColumnsSupplier> xColumnsSupplier; // search the one and only primary key - for(sal_Int32 i=0;i< xKeyIndex->getCount();++i) + const sal_Int32 nCount = xUpdateTableKeys->getCount(); + for(sal_Int32 i = 0 ; i < nCount ; ++i) { - Reference<XPropertySet> xProp; - ::cppu::extractInterface(xProp,xKeyIndex->getByIndex(i)); + Reference<XPropertySet> xProp(xUpdateTableKeys->getByIndex(i),UNO_QUERY); sal_Int32 nKeyType = 0; xProp->getPropertyValue(PROPERTY_TYPE) >>= nKeyType; if(KeyType::PRIMARY == nKeyType) @@ -327,7 +328,7 @@ } } - OKeySet* pKeySet = new OKeySet(m_aUpdateTable,aUpdateTableName ,_xAnalyzer); + OKeySet* pKeySet = new OKeySet(m_aUpdateTable,xUpdateTableKeys,aUpdateTableName ,_xAnalyzer); try { m_pCacheSet = pKeySet; Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: databasedocument.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.44.8.1&r2=1.44.8.2 Delta lines: +52 -87 --------------------- --- databasedocument.cxx 2008-05-28 06:55:46+0000 1.44.8.1 +++ databasedocument.cxx 2008-06-11 12:39:57+0000 1.44.8.2 @@ -37,7 +37,6 @@ #include "module_dba.hxx" #include <comphelper/documentconstants.hxx> -#include <comphelper/interaction.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/numberedcollection.hxx> @@ -142,6 +141,8 @@ using namespace ::cppu; using namespace ::osl; +using ::com::sun::star::awt::XWindow; + //........................................................................ namespace dbaccess { @@ -188,8 +189,8 @@ dispose(); } } -//------------------------------------------------------------------------------ -Any SAL_CALL ODatabaseDocument::queryInterface(const Type& _rType) throw (RuntimeException) +// ----------------------------------------------------------------------------- +Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw (RuntimeException) { // strip XEmbeddedScripts and XScriptInvocationContext if we have any form/report // which already contains macros. In this case, the database document itself is not @@ -293,7 +294,10 @@ { static void lcl_stripLoadArguments( ::comphelper::NamedValueCollection& _rArguments, Sequence< PropertyValue >& _rArgs ) { + OSL_ENSURE( !_rArguments.has( "Model" ), "lcl_stripLoadArguments: this is suspicious (1)!" ); + OSL_ENSURE( !_rArguments.has( "ViewName" ), "lcl_stripLoadArguments: this is suspicious (2)!" ); _rArguments.remove( "Model" ); + _rArguments.remove( "ViewName" ); _rArguments >>= _rArgs; } @@ -321,14 +325,13 @@ static Sequence< PropertyValue > lcl_appendFileNameToDescriptor( const Sequence< PropertyValue >& _rDescriptor, const ::rtl::OUString _rURL ) { - Sequence< PropertyValue > aMediaDescriptor( _rDescriptor ); + ::comphelper::NamedValueCollection aMediaDescriptor( _rDescriptor ); if ( _rURL.getLength() ) { - aMediaDescriptor.realloc( _rDescriptor.getLength() + 1 ); - aMediaDescriptor[ _rDescriptor.getLength() ].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) ); - aMediaDescriptor[ _rDescriptor.getLength() ].Value <<= _rURL; + aMediaDescriptor.put( "FileName", _rURL ); + aMediaDescriptor.put( "URL", _rURL ); } - return aMediaDescriptor; + return aMediaDescriptor.getPropertyValues(); } } @@ -406,16 +409,15 @@ // now that somebody (perhaps) told us an macro execution mode, remember it as // ImposedMacroExecMode - ::comphelper::NamedValueCollection aArgs( m_pImpl->m_aArgs ); m_pImpl->setImposedMacroExecMode( - aArgs.getOrDefault( "MacroExecutionMode", m_pImpl->getImposedMacroExecMode() ) ); + aResource.getOrDefault( "MacroExecutionMode", m_pImpl->getImposedMacroExecMode() ) ); - ::rtl::OUString sDocumentURL( aResource.getOrDefault( "SalvagedFile", _rURL ) ); - if ( !sDocumentURL.getLength() ) + ::rtl::OUString sDocumentLocation( aResource.getOrDefault( "SalvagedFile", _rURL ) ); + if ( !sDocumentLocation.getLength() ) // this indicates "the document is being recovered, but _rURL already is the real document URL, // not the temporary document location" - sDocumentURL = _rURL; - m_pImpl->switchToURL( _rURL, sDocumentURL ); + sDocumentLocation = _rURL; + m_pImpl->switchToURL( sDocumentLocation, _rURL ); bool bSuccess = ( m_pImpl->getOrCreateRootStorage().is() @@ -602,10 +604,7 @@ if ( bLocationChanged ) { // create storage for target URL - Reference< XStorage > xTargetStorage; - if ( !impl_createStorageFor_throw( _rURL, xTargetStorage ) ) - // failed, but handled by an interaction handler - return; + Reference< XStorage > xTargetStorage( impl_createStorageFor_throw( _rURL ) ); if ( m_pImpl->isEmbeddedDatabase() ) m_pImpl->clearConnections(); @@ -652,70 +651,14 @@ } // ----------------------------------------------------------------------------- -bool ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL, Reference< XStorage >& _out_rxStorage ) const +Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL ) const { - _out_rxStorage.clear(); - Sequence<Any> aParam(2); aParam[0] <<= _rURL; aParam[1] <<= ElementModes::READWRITE | ElementModes::TRUNCATE; - Any aOriginalError; - try - { Reference< XSingleServiceFactory > xStorageFactory( m_pImpl->createStorageFactory(), UNO_SET_THROW ); - _out_rxStorage.set( xStorageFactory->createInstanceWithArguments( aParam ), UNO_QUERY_THROW ); - } - catch ( const Exception& ) - { - aOriginalError = ::cppu::getCaughtException(); - } - - if ( _out_rxStorage.is() ) - return true; - - // try handling the error with the interaction handler - ::comphelper::NamedValueCollection aArgs( m_pImpl->m_aArgs ); - Reference< XInteractionHandler > xHandler( aArgs.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ) ); - if ( xHandler.is() ) - { - ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( aOriginalError ) ); - ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); - pRequest->addContinuation( pApprove.get() ); - - try - { - xHandler->handle( pRequest.get() ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - if ( pApprove->wasSelected() ) - return false; - } - - Exception aException; - OSL_VERIFY( aOriginalError >>= aException ); - ::rtl::OUString sOriginalExceptionType = aOriginalError.getValueTypeName(); - ::rtl::OUString sOriginalExceptionMessage = aException.Message; - - // TODO: resource - ::rtl::OUString sMessage = ::rtl::OUString::createFromAscii( "Could not create a storage for '" ); - sMessage += _rURL; - sMessage += ::rtl::OUString::createFromAscii( "'." ); - if ( sOriginalExceptionMessage.getLength() ) - { - sMessage += ::rtl::OUString::createFromAscii( "\noriginal error message: " ); - sMessage += sOriginalExceptionMessage; - } - if ( sOriginalExceptionType.getLength() ) - { - sMessage += ::rtl::OUString::createFromAscii( "\noriginal error type: " ); - sMessage += sOriginalExceptionType; - } - throw IOException( sMessage, *const_cast< ODatabaseDocument* >( this ) ); + return Reference< XStorage >( xStorageFactory->createInstanceWithArguments( aParam ), UNO_QUERY_THROW ); } // ----------------------------------------------------------------------------- @@ -769,10 +712,7 @@ ModifyLock aLock( *this ); // create storage for target URL - Reference< XStorage > xTargetStorage; - if ( !impl_createStorageFor_throw( _rURL, xTargetStorage ) ) - // failed, but handled by an interaction handler - return; + Reference< XStorage > xTargetStorage( impl_createStorageFor_throw( _rURL ) ); // extend media descriptor with URL Sequence< PropertyValue > aMediaDescriptor( lcl_appendFileNameToDescriptor( _rArguments, _rURL ) ); @@ -1444,15 +1384,40 @@ return aNames; } // ----------------------------------------------------------------------------- -Reference< XController > SAL_CALL ODatabaseDocument::createDefaultViewController( const Reference< XFrame >& /*Frame*/, Reference< ::com::sun::star::awt::XWindow >& /*ComponentWindow*/ ) throw (IllegalArgumentException, Exception, RuntimeException) +Reference< XController2 > SAL_CALL ODatabaseDocument::createDefaultViewController( const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException) { - return Reference< XController >(); + return createViewController( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ), + Sequence< PropertyValue >(), + _Frame + ); } + // ----------------------------------------------------------------------------- -Reference< XController > SAL_CALL ODatabaseDocument::createViewController( const ::rtl::OUString& /*ViewName*/, const Sequence< PropertyValue >& /*Arguments*/, const Reference< XFrame >& /*Frame*/, Reference< ::com::sun::star::awt::XWindow >& /*ComponentWindow*/ ) throw (IllegalArgumentException, Exception, RuntimeException) +Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( const ::rtl::OUString& _ViewName, const Sequence< PropertyValue >& _Arguments, const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException) { - return Reference< XController >(); + if ( !_ViewName.equalsAscii( "Default" ) && !_ViewName.equalsAscii( "Preview" ) ) + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); + if ( !_Frame.is() ) + throw IllegalArgumentException( ::rtl::OUString(), *this, 3 ); + + ModelMethodGuard aGuard( *this ); + ::comphelper::ComponentContext aContext( m_pImpl->m_aContext ); + aGuard.clear(); + + Reference< XController2 > xController; + aContext.createComponent( "org.openoffice.comp.dbu.OApplicationController", xController ); + + ::comphelper::NamedValueCollection aInitArgs( _Arguments ); + aInitArgs.put( "Frame", _Frame ); + if ( _ViewName.equalsAscii( "Preview" ) ) + aInitArgs.put( "Preview", sal_Bool( sal_True ) ); + Reference< XInitialization > xInitController( xController, UNO_QUERY_THROW ); + xInitController->initialize( aInitArgs.getWrappedPropertyValues() ); + + return xController; } + // ----------------------------------------------------------------------------- //============================================================================= Reference< XTitle > ODatabaseDocument::impl_getTitleHelper_throw() Directory: /dba/dbaccess/source/core/dataaccess/ ================================================ File [changed]: documentdefinition.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.60.4.1&r2=1.60.4.2 Delta lines: +31 -25 --------------------- --- documentdefinition.cxx 2008-05-22 08:13:37+0000 1.60.4.1 +++ documentdefinition.cxx 2008-06-11 12:40:02+0000 1.60.4.2 @@ -275,8 +275,8 @@ namespace css = ::com::sun::star; -#define DEFAULT_WIDTH 15000 -#define DEFAULT_HEIGHT 10000 +#define DEFAULT_WIDTH 10000 +#define DEFAULT_HEIGHT 7500 //........................................................................ namespace dbaccess { @@ -898,9 +898,14 @@ } } - bool bExecuteDBDocMacros = m_pImpl->m_pDataSource->adjustMacroMode_AutoReject(); - // Note that we don't pass an interaction handler here. If the user has not been asked/notified - // by now (i.e. during loading the whole DB document), then this won't happen anymore. + bool bExecuteDBDocMacros = m_pImpl->m_pDataSource->checkMacrosOnLoading(); + // Note that this call implies the user might be asked for the macro execution mode. + // Normally, this would happen when the database document is loaded, and subsequent calls + // will simply use the user's decision from this point in time. + // However, it is possible to programmatically load forms/reports, without actually + // loading the database document into a frame. In this case, the user will be asked + // here and now. + // #i87741# / 2008-05-05 / [EMAIL PROTECTED] // allow the command arguments to downgrade the macro execution mode, but not to upgrade // it @@ -1112,7 +1117,9 @@ dispose(); } - else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "storeOwn" ) ) ) + else if ( ( aCommand.Name.compareToAscii( "storeOwn" ) == 0 ) // compatibility + || ( aCommand.Name.compareToAscii( "store" ) == 0 ) + ) { Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY); if ( xPersist.is() ) @@ -1647,9 +1654,7 @@ m_xEmbeddedObject->changeState(EmbedStates::RUNNING); if ( bSetSize ) { - ::com::sun::star::awt::Size aSize; - aSize.Width = DEFAULT_WIDTH; - aSize.Height = DEFAULT_HEIGHT; + ::com::sun::star::awt::Size aSize( DEFAULT_WIDTH, DEFAULT_HEIGHT ); m_xEmbeddedObject->setVisualAreaSize(Aspects::MSOLE_CONTENT,aSize); } @@ -1696,6 +1701,7 @@ lcl_putLoadArgs( aMediaDesc, optional_bool(), optional_bool() ); // don't put _bSuppressMacros and _bReadOnly here - if the document was already // loaded, we should not tamper with its settings. + // #i88977# / 2008-05-05 / [EMAIL PROTECTED] // #i86872# / 2008-03-13 / [EMAIL PROTECTED] aMediaDesc >>= aArgs; Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.60.8.1&r2=1.60.8.2 Delta lines: +100 -50 ---------------------- --- AppController.cxx 2008-05-28 06:59:06+0000 1.60.8.1 +++ AppController.cxx 2008-06-11 12:40:09+0000 1.60.8.2 @@ -68,12 +68,12 @@ #include <com/sun/star/container/XHierarchicalNameContainer.hpp> #include <com/sun/star/util/XModifyBroadcaster.hpp> #include <com/sun/star/util/XModifiable.hpp> -#include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/util/XFlushable.hpp> #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" #include "com/sun/star/beans/NamedValue.hpp" #include <com/sun/star/awt/XTopWindow.hpp> +#include <com/sun/star/task/XInteractionHandler.hpp> /** === end UNO includes === **/ #ifndef _TOOLS_DEBUG_HXX @@ -88,6 +88,9 @@ #ifndef _COMPHELPER_TYPES_HXX_ #include <comphelper/types.hxx> #endif +#ifndef _COMPHELPER_INTERACTION_HXX_ +#include <comphelper/interaction.hxx> +#endif #ifndef COMPHELPER_COMPONENTCONTEXT_HXX #include <comphelper/componentcontext.hxx> #endif @@ -227,9 +230,6 @@ #include "dbaccess_slotid.hrc" #endif -#include <boost/mem_fn.hpp> -#include <boost/bind.hpp> -#include <boost/utility.hpp> #include <algorithm> #include <functional> @@ -257,6 +257,7 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::datatransfer; using namespace ::com::sun::star::ui::dialogs; +using namespace ::com::sun::star::task; using ::com::sun::star::document::XEmbeddedScripts; //------------------------------------------------------------------------------ @@ -991,6 +992,38 @@ } return aReturn; } + +// ----------------------------------------------------------------------------- +namespace +{ + bool lcl_handleException_nothrow( const Reference< XModel >& _rxDocument, const Any& _rException ) + { + bool bHandled = false; + + // try handling the error with an interaction handler + ::comphelper::NamedValueCollection aArgs( _rxDocument->getArgs() ); + Reference< XInteractionHandler > xHandler( aArgs.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() ) ); + if ( xHandler.is() ) + { + ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rException ) ); + ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove ); + pRequest->addContinuation( pApprove.get() ); + + try + { + xHandler->handle( pRequest.get() ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + + bHandled = pApprove->wasSelected(); + } + return bHandled; + } +} + // ----------------------------------------------------------------------------- void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs) { @@ -1122,11 +1155,18 @@ break; case ID_BROWSER_SAVEDOC: { - Reference<XStorable> xStore(m_xModel,UNO_QUERY); - if ( xStore.is() ) + Reference< XStorable > xStore( m_xModel, UNO_QUERY_THROW ); + try + { xStore->store(); } + catch( const Exception& ) + { + lcl_handleException_nothrow( m_xModel, ::cppu::getCaughtException() ); + } + } break; + case ID_BROWSER_SAVEASDOC: { WinBits nBits(WB_STDMODAL|WB_SAVEAS); @@ -1146,15 +1186,20 @@ aFileDlg.SetCurrentFilter(pFilter->GetUIName()); } - if ( aFileDlg.Execute() == ERRCODE_NONE ) - { - Reference<XStorable> xStore(m_xModel,UNO_QUERY); - if ( xStore.is() ) - { + if ( aFileDlg.Execute() != ERRCODE_NONE ) + break; + + Reference<XStorable> xStore( m_xModel, UNO_QUERY_THROW ); INetURLObject aURL( aFileDlg.GetPath() ); - if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + try + { + xStore->storeAsURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), Sequence< PropertyValue >() ); + } + catch( const Exception& ) { - xStore->storeAsURL(aURL.GetMainURL( INetURLObject::NO_DECODE ),Sequence<PropertyValue>()); + lcl_handleException_nothrow( m_xModel, ::cppu::getCaughtException() ); + } + m_sDatabaseName = ::rtl::OUString(); /*updateTitle();*/ m_bCurrentlyModified = sal_False; @@ -1165,9 +1210,6 @@ getContainer()->selectContainer(E_TABLE); } } - } - } - } break; case ID_BROWSER_SORTUP: getContainer()->sortUp(); @@ -1709,8 +1751,7 @@ InvalidateAll(); EventObject aEvent(*this); - m_aSelectionListeners.forEach<XSelectionChangeListener>( - ::boost::bind(&XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent))); + m_aSelectionListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvent ); } m_eCurrentType = _eType; @@ -2136,8 +2177,7 @@ { InvalidateAll(); EventObject aEvent(*this); - m_aSelectionListeners.forEach<XSelectionChangeListener>( - ::boost::bind(&XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent))); + m_aSelectionListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvent ); } // ----------------------------------------------------------------------------- void OApplicationController::onEntrySelect(SvLBoxEntry* _pEntry) @@ -2155,8 +2195,7 @@ } EventObject aEvent(*this); - m_aSelectionListeners.forEach<XSelectionChangeListener>( - ::boost::bind(&XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent))); + m_aSelectionListeners.notifyEach( &XSelectionChangeListener::selectionChanged, aEvent ); } } // ----------------------------------------------------------------------------- @@ -2505,14 +2544,25 @@ return 0L; } + try + { + // If the migration just happened, but was not successful, the document is reloaded. + // In this case, we should not show the warning, again. + ::comphelper::NamedValueCollection aModelArgs( m_xModel->getArgs() ); + if ( aModelArgs.getOrDefault( "SuppressMigrationWarning", sal_False ) ) + return 0L; + + // also, if the document is read-only, then no migration is possible, and the + // respective menu entry is hidden. So, don't show the warning in this case, too. + if ( Reference< XStorable >( m_xModel, UNO_QUERY_THROW )->isReadonly() ) + return 0L; + SQLWarning aWarning; aWarning.Message = String( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS ) ); SQLException aDetail; aDetail.Message = String( ModuleRes( STR_SUB_DOCS_WITH_SCRIPTS_DETAIL ) ); aWarning.NextException <<= aDetail; - try - { ::comphelper::ComponentContext aContext( getORB() ); Sequence< Any > aArgs(1); aArgs[0] <<= NamedValue( PROPERTY_SQLEXCEPTION, makeAny( aWarning ) ); Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: dbloader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.36.6.1&r2=1.36.6.2 Delta lines: +9 -6 ------------------- --- dbloader.cxx 2008-05-23 08:36:38+0000 1.36.6.1 +++ dbloader.cxx 2008-06-11 12:40:12+0000 1.36.6.2 @@ -40,7 +40,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XSet.hpp> #include <com/sun/star/document/XEventListener.hpp> -#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrameLoader.hpp> #include <com/sun/star/frame/XLoadEventListener.hpp> @@ -216,7 +216,7 @@ }; INetURLObject aParser( rURL ); - Reference< XController > xController; + Reference< XController2 > xController; const ::rtl::OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); for ( size_t i=0; i < sizeof( aImplementations ) / sizeof( aImplementations[0] ); ++i ) @@ -269,8 +269,8 @@ if ( xController.is() ) { xController->attachModel( xReportModel ); - xReportModel->connectController( xController ); - xReportModel->setCurrentController( xController ); + xReportModel->connectController( xController.get() ); + xReportModel->setCurrentController( xController.get() ); } } } @@ -330,7 +330,10 @@ if ( bSuccess ) { if ( xController.is() && rFrame.is() ) + { + rFrame->setComponent( xController->getComponentWindow(), xController.get() ); xController->attachFrame(rFrame); + } if ( xDatabaseDocument.is() ) { Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: genericcontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.87.2.3&r2=1.87.2.4 Delta lines: +29 -26 --------------------- --- genericcontroller.cxx 2008-05-21 11:57:37+0000 1.87.2.3 +++ genericcontroller.cxx 2008-06-11 12:40:17+0000 1.87.2.4 @@ -262,11 +262,6 @@ return 0L; } // ----------------------------------------------------------------------------- -Reference< XWindow > OGenericUnoController::getComponentWindow() const -{ - return VCLUnoHelper::GetInterface( getView() ); -} -// ----------------------------------------------------------------------------- void OGenericUnoController::impl_initialize() { } @@ -303,28 +298,26 @@ } try { - if ( xFrame.is() ) - { + if ( !xFrame.is() ) + throw IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "need a frame" ) ), *this, 1 ); + xParent = xFrame->getContainerWindow(); VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(xParent); Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL; if (!pParentWin) { - throw Exception(::rtl::OUString::createFromAscii("Parent window is null"),*this); + throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "Parent window is null" ), *this, 1 ); } m_aInitParameters.assign( aArguments ); Construct( pParentWin ); - if ( !getView() ) - throw Exception(::rtl::OUString::createFromAscii("Window is null"),*this); - } - else - { - OSL_ENSURE(0,"OGenericUnoController::initialize: Frame is null!"); - } + ODataView* pView = getView(); - if ( (m_bReadOnly || m_bPreview) && pView ) - pView->EnableInput(FALSE); + if ( !pView ) + throw RuntimeException( ::rtl::OUString::createFromAscii( "unable to create a view" ), *this ); + + if ( m_bReadOnly || m_bPreview ) + pView->EnableInput( FALSE ); impl_initialize(); } @@ -335,8 +328,6 @@ m_pView = NULL; throw e; } - if ( xFrame.is() ) - xFrame->setComponent(getComponentWindow(), this); } //------------------------------------------------------------------------------ @@ -388,6 +379,18 @@ InvalidateFeature(ID_BROWSER_UNDO); } // ----------------------------------------------------------------------- +Reference< XWindow > SAL_CALL OGenericUnoController::getComponentWindow() throw (RuntimeException) +{ + return VCLUnoHelper::GetInterface( getView() ); +} + +// ----------------------------------------------------------------------- +::rtl::OUString SAL_CALL OGenericUnoController::getViewControllerName() throw (::com::sun::star::uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Default" ) ); +} + +// ----------------------------------------------------------------------- void OGenericUnoController::attachFrame( const Reference< XFrame >& _rxFrame ) throw( RuntimeException ) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: QueryDesignView.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/QueryDesignView.cxx?r1=1.91.2.3&r2=1.91.2.4 Delta lines: +10 -2 -------------------- --- QueryDesignView.cxx 2008-05-23 08:36:38+0000 1.91.2.3 +++ QueryDesignView.cxx 2008-06-11 12:40:24+0000 1.91.2.4 @@ -1508,8 +1508,12 @@ OTableFieldDescRef aDragLeft = new OTableFieldDesc(); if ( eOk == ( eErrorCode = FillDragInfo(_pView,pValueExp,aDragLeft) )) + { + if ( bHaving ) + aDragLeft->SetGroupBy(sal_True); _pSelectionBrw->AddCondition(aDragLeft, aCondition, nLevel,bAddOrOnOneLine); } + } else if(SQL_ISRULEOR2(pValueExp,general_set_fct ,set_fct_spec) || SQL_ISRULEOR2(pValueExp,position_exp,extract_exp) || SQL_ISRULEOR2(pValueExp,fold,char_substring_fct) || @@ -1547,9 +1551,13 @@ ::rtl::OUString sCondition = ParseCondition(pController,pCondition,sDecimal,aLocale,1); OTableFieldDescRef aDragLeft = new OTableFieldDesc(); if ( eOk == ( eErrorCode = FillDragInfo(_pView,pCondition->getChild(0),aDragLeft)) ) + { + if ( bHaving ) + aDragLeft->SetGroupBy(sal_True); _pSelectionBrw->AddCondition(aDragLeft, sCondition, nLevel,bAddOrOnOneLine); } } + } else if( SQL_ISRULEOR2(pCondition,existence_test,unique_test) ) { Directory: /dba/dbaccess/util/defs/ =================================== File [removed]: wntmsci12 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
