User: ihi Date: 2007/04/16 09:24:34 Modified: dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
Log: INTEGRATION: CWS fwkdbdesign01 (1.40.76); FILE MERGED 2007/03/13 14:41:06 fs 1.40.76.3: #i69735# impl_appendFrameToDocumentFrames_throw 2007/03/05 08:48:21 fs 1.40.76.2: #i74951# SimpleReportDesign->TextReportDesign 2007/02/27 08:54:58 as 1.40.76.1: #i45663# set module names for reused office module components File Changes: 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.40&r2=1.41 Delta lines: +46 -5 -------------------- --- documentdefinition.cxx 17 Sep 2006 06:40:25 -0000 1.40 +++ documentdefinition.cxx 16 Apr 2007 16:24:31 -0000 1.41 @@ -87,6 +87,9 @@ #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HPP_ #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #endif +#ifndef _COM_SUN_STAR_FRAME_XFRAMESSUPPLIER_HPP_ +#include <com/sun/star/frame/XFramesSupplier.hpp> +#endif #ifndef _COM_SUN_STAR_UCB_INSERTCOMMANDARGUMENT_HPP_ #include <com/sun/star/ucb/InsertCommandArgument.hpp> #endif @@ -138,6 +141,9 @@ #ifndef _COM_SUN_STAR_UTIL_XCLOSEBROADCASTER_HPP_ #include <com/sun/star/util/XCloseBroadcaster.hpp> #endif +#ifndef _COM_SUN_STAR_FRAME_XMODULE_HPP_ +#include <com/sun/star/frame/XModule.hpp> +#endif #ifndef _COM_SUN_STAR_DATATRANSFER_DATAFLAVOR_HPP_ #include <com/sun/star/datatransfer/DataFlavor.hpp> #endif @@ -656,6 +662,30 @@ } // ----------------------------------------------------------------------------- +void ODocumentDefinition::impl_appendFrameToDocumentFrames_throw( const Reference< XFrame >& _rxFrame ) +{ + Reference< XModel > xDatabaseDocumentModel; + if ( m_pImpl->m_pDataSource ) + xDatabaseDocumentModel = m_pImpl->m_pDataSource->getModel_noCreate(); + + Reference< XController > xDatabaseDocumentController; + if ( xDatabaseDocumentModel.is() ) + xDatabaseDocumentController = xDatabaseDocumentModel->getCurrentController(); + + Reference< XFramesSupplier > xDatabaseDocumentFramesSupp; + if ( xDatabaseDocumentController.is() ) + xDatabaseDocumentFramesSupp = xDatabaseDocumentFramesSupp.query( xDatabaseDocumentController->getFrame() ); + + Reference< XFrames > xDatabaseDocumentFrames; + if ( xDatabaseDocumentFramesSupp.is() ) + xDatabaseDocumentFrames = xDatabaseDocumentFramesSupp->getFrames(); + + OSL_ENSURE( xDatabaseDocumentFrames.is(), "ODocumentDefinition::impl_appendFrameToDocumentFrames_throw: cannot append the component frame to the document's frame!" ); + if ( xDatabaseDocumentFrames.is() ) + xDatabaseDocumentFrames->append( _rxFrame ); +} + +// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_onActivateEmbeddedObject( bool _bOpenedInDesignMode ) { try @@ -671,11 +701,17 @@ m_xListener = new OEmbedObjectHolder(m_xEmbeddedObject,this); Reference< XFrame > xFrame( xController->getFrame() ); - // raise the window to top (especially necessary if this is not the first activation) if ( xFrame.is() ) { + // raise the window to top (especially necessary if this is not the first activation) Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW ); xTopWindow->toFront(); + + // remove the frame from the desktop's frame collection because we need full control of it. + impl_removeFrameFromDesktop_throw( xFrame ); + + // ensure that the component's frame is a child of the database document's frame + impl_appendFrameToDocumentFrames_throw( xFrame ); } // ensure that we ourself are kept alive as long as the embedded object's frame is @@ -685,9 +721,6 @@ // init the edit view if ( _bOpenedInDesignMode ) impl_initObjectEditView( xController ); - - // remove the frame from the desktop's frame collection because we need full control of it. - impl_removeFrameFromDesktop_throw( xFrame ); } catch( const RuntimeException& ) { @@ -893,6 +926,14 @@ if ( !bOpenForMail ) { + Reference< XModule> xModule(xModel,UNO_QUERY); + if ( xModule.is() ) + { + if ( m_bForm ) + xModule->setIdentifier(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.FormDesign"))); + else + xModule->setIdentifier(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.TextReportDesign"))); + } m_xEmbeddedObject->changeState(EmbedStates::ACTIVE); impl_onActivateEmbeddedObject( bOpenInDesign ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
