diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 54e950a3b6eb..d2a313f3ed03 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -366,6 +366,17 @@ void SAL_CALL ChartController::attachFrame( if( impl_isDisposedOrSuspended() ) //@todo? allow attaching the frame while suspended? return; //behave passive if already disposed or suspended + if(m_xFrame.is()) //what happens, if we do have a Frame already?? + { + //@todo? throw exception? + OSL_FAIL( "there is already a frame attached to the controller" ); + return; + } + + //--attach frame + m_xFrame = xFrame; //the frameloader is responsible to call xFrame->setComponent + + // Only notify after setting the frame, otherwise notification will fail mpSelectionChangeHandler->Connect(); uno::Reference xSidebar = getSidebarFromModel(getChartModel()); @@ -379,16 +390,6 @@ void SAL_CALL ChartController::attachFrame( mpSelectionChangeHandler->selectionChanged(aEvent); } - if(m_xFrame.is()) //what happens, if we do have a Frame already?? - { - //@todo? throw exception? - OSL_FAIL( "there is already a frame attached to the controller" ); - return; - } - - //--attach frame - m_xFrame = xFrame; //the frameloader is responsible to call xFrame->setComponent - //add as disposelistener to the frame (due to persistent reference) ??...: //the frame is considered to be owner of this controller and will live longer than we do diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx index 76424b3aea03..b2f6db457fac 100644 --- a/framework/source/services/ContextChangeEventMultiplexer.cxx +++ b/framework/source/services/ContextChangeEventMultiplexer.cxx @@ -162,23 +162,6 @@ void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener ( if (!(rxEventFocus.is() && pFocusDescriptor!=nullptr)) return; - if (pFocusDescriptor->msCurrentApplicationName.isEmpty() && pFocusDescriptor->msCurrentContextName.isEmpty() - && rxEventFocus.is()) - { - Reference< lang::XServiceInfo > xServInfo( rxEventFocus, uno::UNO_QUERY ); - if( xServInfo.is() && xServInfo->getImplementationName() == "com.sun.star.comp.chart2.ChartController") - { - css::ui::ContextChangeEventObject aEvent ( - rxEventFocus, - "com.sun.star.chart2.ChartDocument", - "Chart"); - rxListener->notifyContextChangeEvent(aEvent); - - return; - } - - } - css::ui::ContextChangeEventObject aEvent ( nullptr, pFocusDescriptor->msCurrentApplicationName,