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

Caolán McNamara caolanm at redhat.com
Mon Oct 16 20:22:55 UTC 2017


 unoxml/source/events/eventdispatcher.cxx |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 68f8200e1cd22ad9e65d7fce6dfae8f3a24d88c7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Oct 15 21:23:37 2017 +0100

    ofz: timeouts in fods/fodt/fodp
    
    Change-Id: I543d4bc41d06712cef81b8b0853144625f0b9940
    Reviewed-on: https://gerrit.libreoffice.org/43413
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index a68256a278fa..51572eea5e99 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -107,6 +107,18 @@ namespace DOM { namespace events {
             xmlNodePtr const pNode, Reference<XNode> const& xNode,
             Reference< XEvent > const& i_xEvent) const
     {
+        TypeListenerMap captureListeners;
+        TypeListenerMap targetListeners;
+        {
+            ::osl::MutexGuard g(rMutex);
+
+            captureListeners = m_CaptureListeners;
+            targetListeners = m_TargetListeners;
+        }
+
+        if (captureListeners.empty() && targetListeners.empty())
+            return true;
+
         CEvent *pEvent = nullptr; // pointer to internal event representation
 
         OUString const aType = i_xEvent->getType();
@@ -180,8 +192,6 @@ namespace DOM { namespace events {
         typedef std::vector< ::std::pair<Reference<XEventTarget>, xmlNodePtr> >
             NodeVector_t;
         NodeVector_t captureVector;
-        TypeListenerMap captureListeners;
-        TypeListenerMap targetListeners;
         {
             ::osl::MutexGuard g(rMutex);
 
@@ -193,8 +203,6 @@ namespace DOM { namespace events {
                 captureVector.emplace_back(xRef, cur);
                 cur = cur->parent;
             }
-            captureListeners = m_CaptureListeners;
-            targetListeners = m_TargetListeners;
         }
 
         // the capture vector now holds the node path from target to root


More information about the Libreoffice-commits mailing list