chart2/source/controller/main/ChartController.cxx           |   21 ++++++------
 framework/source/services/ContextChangeEventMultiplexer.cxx |   17 ---------
 2 files changed, 11 insertions(+), 27 deletions(-)

New commits:
commit f66b5c4bdf7d285d8eae6231b9dc906eca065072
Author:     Mike Kaganski <[email protected]>
AuthorDate: Fri Apr 22 16:17:09 2022 +0300
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sun Jun 5 07:34:07 2022 +0200

    Drop a bit more special-casing for Chart's sidebar property deck
    
    Introduced in commit 2d01ed9e8be543460e41e009fa992103a7c8d4c0
      Author Muhammet Kara <[email protected]>
      Date   Mon Nov 25 21:55:31 2019 +0300
        tdf#94288: Show chart props sidebar on activation
    
    The problem was that ChartController::attachFrame, that called
    SelectionChangeHandler::selectionChanged notification, did that
    *prior* to setting its m_xFrame - and the notification failed
    in ContextChangeEventMultiplexer::NotifyContextChange, that
    checks the frame first. That prevented the proper context (with
    correct application and context names) to arrive to listeners,
    and the sidebar didn't update properly.
    
    Changing the order of the calls should fix the original problem.
    
    Change-Id: I9da8465af2ee4ed1f8eabed1c65d1c318f81a3f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133326
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135396
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 19c314da2635..f50fab660acf 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -385,6 +385,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<ui::XSidebar> xSidebar = getSidebarFromModel(getModel());
@@ -398,16 +409,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 0dea0823c52b..887fa946856a 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,

Reply via email to