summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-09-15 12:18:40 +0200
committerNoel Grandin <noel@peralex.com>2015-09-16 08:38:54 +0200
commitc52baea785109ff546159128c7502533477c9331 (patch)
tree54d001522ba6fd16976e4758408600e6a1fbfbd8 /vcl/source/window
parent91d06b09ae019f09bca54718c1c24907762aa3ea (diff)
clean up VclEventListeners and VclEventListeners2
Move them inside the vcl module. there is no need to expose their implementation. Make the VclEventListeners2 implementation similar to the VclEventListeners implemenation - I can't see the benefit of this extra complication with invalidated iterators, given the very small number of listeners typically on such a list. Change-Id: I040ddd24b10d2109af13ee25b5181703af17a109
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/menu.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e49ff60f5ec4..e5acc2eca589 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -3240,16 +3240,24 @@ ImplMenuDelData::~ImplMenuDelData()
namespace vcl { namespace MenuInvalidator {
static VclEventListeners2* pMenuInvalidateListeners = NULL;
- VclEventListeners2* GetMenuInvalidateListeners()
+ void AddMenuInvalidateListener(const Link<>& rLink)
{
if(!pMenuInvalidateListeners)
pMenuInvalidateListeners = new VclEventListeners2();
- return pMenuInvalidateListeners;
+ pMenuInvalidateListeners->addListener(rLink);
+ }
+ void CallMenuInvalidateListeners(VclSimpleEvent* pEvent)
+ {
+ if(pMenuInvalidateListeners)
+ pMenuInvalidateListeners->callListeners(pEvent);
}
void Invalidated()
{
- VclSimpleEvent aEvent(0);
- GetMenuInvalidateListeners()->callListeners(&aEvent);
+ if(pMenuInvalidateListeners)
+ {
+ VclSimpleEvent aEvent(0);
+ pMenuInvalidateListeners->callListeners(&aEvent);
+ }
};
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */