summaryrefslogtreecommitdiff
path: root/toolkit/source/awt/vclxtoolkit.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-01-19 19:45:45 +0200
committerNoel Grandin <noel@peralex.com>2016-01-25 08:52:03 +0200
commit752cd07d085ac0aadc99bd512d49072843139032 (patch)
tree21ff2f55761b34bfdd721b5e1ed43333e8874e46 /toolkit/source/awt/vclxtoolkit.cxx
parent0e7cd653ea90da388820220bf6a3eb140b57bbd6 (diff)
InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer. It uses a std::vector instead of a Sequence for the mutable listener list, which provides far better performance. Switch all our internal use-sites to the new class. Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
Diffstat (limited to 'toolkit/source/awt/vclxtoolkit.cxx')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 13e79821e925..6929c5849045 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -157,9 +157,9 @@ class VCLXToolkit : public VCLXToolkitMutexHelper,
oslModule hSvToolsLib;
FN_SvtCreateWindow fnSvtCreateWindow;
- ::cppu::OInterfaceContainerHelper m_aTopWindowListeners;
- ::cppu::OInterfaceContainerHelper m_aKeyHandlers;
- ::cppu::OInterfaceContainerHelper m_aFocusListeners;
+ ::comphelper::OInterfaceContainerHelper2 m_aTopWindowListeners;
+ ::comphelper::OInterfaceContainerHelper2 m_aKeyHandlers;
+ ::comphelper::OInterfaceContainerHelper2 m_aFocusListeners;
::Link<VclSimpleEvent&,void> m_aEventListenerLink;
::Link<VclWindowEvent&,bool> m_aKeyListenerLink;
bool m_bEventListener;
@@ -1774,13 +1774,13 @@ void VCLXToolkit::callTopWindowListeners(
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
if (pWindow->IsTopWindow())
{
- css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ std::vector< css::uno::Reference< css::uno::XInterface > >
aListeners(m_aTopWindowListeners.getElements());
- if (aListeners.hasElements())
+ if (!aListeners.empty())
{
css::lang::EventObject aAwtEvent(
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()));
- for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
+ for (::sal_Int32 i = 0; i < (sal_Int32)aListeners.size(); ++i)
{
css::uno::Reference< css::awt::XTopWindowListener >
xListener(aListeners[i], css::uno::UNO_QUERY);
@@ -1803,10 +1803,10 @@ void VCLXToolkit::callTopWindowListeners(
bool VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
bool bPressed)
{
- css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ std::vector< css::uno::Reference< css::uno::XInterface > >
aHandlers(m_aKeyHandlers.getElements());
- if (aHandlers.hasElements())
+ if (!aHandlers.empty())
{
vcl::Window * pWindow = static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
@@ -1826,7 +1826,7 @@ bool VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
pKeyEvent->GetKeyCode().GetCode(), pKeyEvent->GetCharCode(),
sal::static_int_cast< sal_Int16 >(
pKeyEvent->GetKeyCode().GetFunction()));
- for (::sal_Int32 i = 0; i < aHandlers.getLength(); ++i)
+ for (::sal_Int32 i = 0; i < (sal_Int32)aHandlers.size(); ++i)
{
css::uno::Reference< css::awt::XKeyHandler > xHandler(
aHandlers[i], css::uno::UNO_QUERY);
@@ -1855,9 +1855,9 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
= static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow();
if (pWindow->IsTopWindow())
{
- css::uno::Sequence< css::uno::Reference< css::uno::XInterface > >
+ std::vector< css::uno::Reference< css::uno::XInterface > >
aListeners(m_aFocusListeners.getElements());
- if (aListeners.hasElements())
+ if (!aListeners.empty())
{
// Ignore the interior of compound controls when determining the
// window that gets the focus next (see implementation in
@@ -1876,7 +1876,7 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
static_cast<sal_Int16>(pWindow->GetGetFocusFlags()),
xNext, false);
- for (::sal_Int32 i = 0; i < aListeners.getLength(); ++i)
+ for (::sal_Int32 i = 0; i < (sal_Int32)aListeners.size(); ++i)
{
css::uno::Reference< css::awt::XFocusListener > xListener(
aListeners[i], css::uno::UNO_QUERY);