LibreOffice Module UnoControls (master) 1
Namespaces | Macros
multiplexer.cxx File Reference
#include <multiplexer.hxx>
#include <osl/diagnose.h>
#include <cppuhelper/queryinterface.hxx>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
Include dependency graph for multiplexer.cxx:

Go to the source code of this file.

Namespaces

namespace  unocontrols
 

Macros

#define MULTIPLEX(INTERFACE, METHOD, EVENTTYP, EVENT)
 

Macro Definition Documentation

◆ MULTIPLEX

#define MULTIPLEX (   INTERFACE,
  METHOD,
  EVENTTYP,
  EVENT 
)
Value:
\
/* First get all interfaces from container with right type.*/ \
comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerHolder.getContainer( cppu::UnoType<INTERFACE>::get() ); \
/* Do the follow only, if elements in container exist.*/ \
if( !pContainer ) \
return; \
comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); \
EVENTTYP aLocalEvent = EVENT; \
/* Remark: The control is the event source not the peer.*/ \
/* We must change the source of the event. */ \
aLocalEvent.Source = m_xControl; \
/* Is the control not destroyed? */ \
if( !aLocalEvent.Source ) \
return; \
if( !aIterator.hasMoreElements() ) \
return; \
INTERFACE * pListener = static_cast<INTERFACE *>(aIterator.next()); \
try \
{ \
pListener->METHOD( aLocalEvent ); \
} \
catch(const RuntimeException& ) \
{ \
/* Ignore all system exceptions from the listener! */ \
}
Reference< XControl > m_xControl

Definition at line 38 of file multiplexer.cxx.