[Libreoffice-commits] core.git: vcl/source

Maxim Monastirsky momonasmon at gmail.com
Tue Nov 17 08:03:35 PST 2015


 vcl/source/helper/commandinfoprovider.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit c2d7b58662951c5d482e882ae730e532988d2ea3
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Tue Nov 17 18:01:13 2015 +0200

    Need to re-init CommandInfoProvider when component changes
    
    Otherwise many toolbar/menubar labels are missing when
    starting any component from the start center.
    
    Change-Id: I49d009431ae3d1003e5ff395265409b3a5641707

diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index 6a7e868..b04cff3 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -38,7 +38,7 @@ using namespace css::uno;
 namespace
 {
     typedef ::cppu::WeakComponentImplHelper <
-        css::lang::XEventListener
+        css::frame::XFrameActionListener
         > FrameListenerInterfaceBase;
     class FrameListener
         : public ::cppu::BaseMutex,
@@ -51,15 +51,23 @@ namespace
               mxFrame(rxFrame)
         {
             if (mxFrame.is())
-                mxFrame->addEventListener(this);
+                mxFrame->addFrameActionListener(this);
         }
         virtual ~FrameListener()
         {
         }
+        virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent)
+            throw (css::uno::RuntimeException, std::exception) override
+        {
+            // The same frame can be reused for a different component, e.g.
+            // starting component from the start center, so need to re-init the cached data.
+            if (aEvent.Action == css::frame::FrameAction_COMPONENT_DETACHING)
+                mrInfoProvider.SetFrame(nullptr);
+        }
         virtual void SAL_CALL disposing() override
         {
             if (mxFrame.is())
-                mxFrame->removeEventListener(this);
+                mxFrame->removeFrameActionListener(this);
         }
         virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
             throw (RuntimeException, std::exception) override


More information about the Libreoffice-commits mailing list