Tag: cws_src680_odbmacros2 User: fs Date: 2007-12-20 10:19:30+0000 Modified: dba/dbaccess/source/ui/misc/controllerframe.cxx
Log: #i49133# never reset the CurrentComponent to NULL. Even upon deactivation, it stays untouched, until another component is activated and sets it to itself. / #i84767# set the parent frame's active frame File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: controllerframe.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/controllerframe.cxx?r1=1.1.2.4&r2=1.1.2.5 Delta lines: +15 -17 --------------------- --- controllerframe.cxx 2007-12-19 15:04:22+0000 1.1.2.4 +++ controllerframe.cxx 2007-12-20 10:19:28+0000 1.1.2.5 @@ -4,9 +4,9 @@ * * $RCSfile: controllerframe.cxx,v $ * - * $Revision: 1.1.2.4 $ + * $Revision: 1.1.2.5 $ * - * last change: $Author: fs $ $Date: 2007/12/19 15:04:22 $ + * last change: $Author: fs $ $Date: 2007/12/20 10:19:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -96,35 +96,33 @@ * the global working document (aka Basic's ThisComponent in the application Basic), with our controller's model, or the controller itself if there is no such model. + * the "active frame" attribute of the parent of the controller's frame */ static void lcl_updateActiveComponents_nothrow( const ControllerFrame_Data& _rData ) { try { Reference< XController > xCompController( _rData.m_rController.getXController() ); - Reference< XModel > xModel; - if ( xCompController.is() ) - xModel = xCompController->getModel(); + OSL_ENSURE( xCompController.is(), "lcl_updateActiveComponents_nothrow: can't do anything without a controller!" ); + if ( !xCompController.is() ) + return; if ( _rData.m_bActive ) { + // set the "current component" at the SfxObjectShell + Reference< XModel > xModel( xCompController->getModel() ); Reference< XInterface > xCurrentComponent; if ( xModel.is() ) xCurrentComponent = xModel; - else if ( xCompController.is() ) + else xCurrentComponent = xCompController; - - OSL_ENSURE( xCurrentComponent.is(), "lcl_updateActiveComponents_nothrow: no model *and* no controller!?" ); - if ( xCurrentComponent.is() ) SfxObjectShell::SetCurrentComponent( xCurrentComponent ); - } - else - { - Reference< XInterface > xCurrentComponent = SfxObjectShell::GetCurrentComponent(); - if ( ( xModel.is() && ( xModel == xCurrentComponent ) ) - || ( xCompController.is() && ( xCompController == xCurrentComponent ) ) - ) - SfxObjectShell::SetCurrentComponent( Reference< XInterface >() ); + + // notify the parent of the controller's frame that there is a new active + // frame + Reference< XFrame > xCompFrame( xCompController->getFrame(), UNO_SET_THROW ); + Reference< XFramesSupplier > xFrames( xCompFrame->getCreator(), UNO_QUERY_THROW ); + xFrames->setActiveFrame( xCompFrame ); } } catch( const Exception& ) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
