summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-11-17 18:01:13 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2015-11-17 18:02:46 +0200
commitc2d7b58662951c5d482e882ae730e532988d2ea3 (patch)
tree5dcba99445dc68076e4c2994e6f263b5a2574e52 /vcl
parent5b86fdca2cd080683c507d85d2bea228fa10e69c (diff)
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
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index 6a7e86802956..b04cff3827ae 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