Tag: cws_src680_warnings01 User: sb Date: 06/04/07 13:47:50 Modified: /dba/dbaccess/source/core/dataaccess/ documentdefinition.cxx
Log: RESYNC: (1.34-1.35); FILE MERGED 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.34.22.1&r2=1.34.22.2 Delta lines: +29 -29 --------------------- --- documentdefinition.cxx 24 Mar 2006 15:35:53 -0000 1.34.22.1 +++ documentdefinition.cxx 7 Apr 2006 20:47:47 -0000 1.34.22.2 @@ -576,7 +576,7 @@ ::osl::MutexGuard aGuard(m_aMutex); closeObject(); ::comphelper::disposeComponent(m_xListener); - m_xFrameLoader = NULL; + m_xDesktop = NULL; } // ----------------------------------------------------------------------------- IMPLEMENT_TYPEPROVIDER3(ODocumentDefinition,OContentHelper,OPropertyStateContainer,ODocumentDefinition_Base); @@ -643,6 +643,16 @@ } // ----------------------------------------------------------------------------- +void ODocumentDefinition::impl_removeFrameFromDesktop_throw( const Reference< XFrame >& _rxFrame ) +{ + if ( !m_xDesktop.is() ) + m_xDesktop.set( m_xORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); + + Reference< XFrames > xFrames( m_xDesktop->getFrames(), UNO_QUERY_THROW ); + xFrames->remove( _rxFrame ); +} + +// ----------------------------------------------------------------------------- void ODocumentDefinition::impl_onActivateEmbeddedObject( bool _bOpenedInDesignMode ) { try @@ -651,40 +661,30 @@ Reference< XController > xController( xModel.is() ? xModel->getCurrentController() : Reference< XController >() ); if ( !xController.is() ) return; - Reference< XFrame > xFrame( xController->getFrame() ); - if ( m_xListener.is() ) - { - // simply raise the window to top + if ( !m_xListener.is() ) + // it's the first time the embedded object has been activated + // create an OEmbedObjectHolder + 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() ) { Reference< XTopWindow > xTopWindow( xFrame->getContainerWindow(), UNO_QUERY_THROW ); xTopWindow->toFront(); } - } - else - { - // it's the first time the embedded object has been activated - - // - if ( !m_xFrameLoader.is() ) - m_xFrameLoader.set( m_xORB->createInstance( SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW ); -/* - // remove the frame from the desktop's frame collection because we need full control of it. - Reference< XFramesSupplier > xSup( m_xFrameLoader, UNO_QUERY_THROW ); - Reference< XFrames > xFrames( xSup->getFrames(), UNO_QUERY_THROW ); - xFrames->remove( xFrame ); -*/ - // create an OEmbedObjectHolder - m_xListener = new OEmbedObjectHolder(m_xEmbeddedObject,this); // ensure that we ourself are kept alive as long as the embedded object's frame is // opened LifetimeCoupler::couple( *this, Reference< XComponent >( xFrame, UNO_QUERY_THROW ) ); - } + // 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& ) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
