summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2016-03-02 15:28:36 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-29 15:00:47 +0200
commit3335c2ec962e08f78f833fb4f62869d2d587fef0 (patch)
tree8d92fdbd5945de0d071f889f83748b608d309e1b
parentbf3c773feddc761ecdf5b8ebb18c78f56d687eb8 (diff)
framework: avoid excessive queryDispatch calls
Make better use of the css::frame::XInterceptorInfo interface, to avoid calling queryDispatch() pointlessly on interfaces that have explicitely opted out. Since that already broadcasts which urls we're interested in - so just don't bother calling entries who are not matching. Reviewed-on: https://gerrit.libreoffice.org/25214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 27b6cdb5ab5af33dbba561923c8db81e144c88b9) Conflicts: framework/source/dispatch/interceptionhelper.cxx Change-Id: Id5e780568fd60c38f4cee4ee800d747d65a31dae
-rw-r--r--framework/source/dispatch/interceptionhelper.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx
index 8052ecdedc9e..b38ee5864e3a 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -66,16 +66,23 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD
xInterceptor = pIt->xInterceptor;
// b) No match by registration - but a valid interceptor list.
- // Use first interceptor everytimes.
- // Note: it doesn't matter, which direction this helper implementation use to ask interceptor objects.
- // Using of member m_aInterceptorList will starts at the beginning everytimes.
- // It depends from the filling operation, in which direction it works realy!
+ // Find first interceptor w/o pattern, so we need to query it
if (!xInterceptor.is() && m_lInterceptionRegs.size()>0)
{
- pIt = m_lInterceptionRegs.begin();
- xInterceptor = pIt->xInterceptor;
+ InterceptorList::const_iterator pIt2;
+ for (pIt2=m_lInterceptionRegs.begin(); pIt2!=m_lInterceptionRegs.end(); ++pIt2)
+ {
+ if (!pIt2->lURLPattern.getLength())
+ {
+ // no pattern -> need to ask this guy!
+ xInterceptor = pIt2->xInterceptor;
+ break;
+ }
+ }
+ // if we didn't find any non-pattern interceptor, there's no-one
+ // registered for this command url (we already searched for matching
+ // patterns above)
}
-
// c) No registered interceptor => use our direct slave.
// This helper exist by design and must be valid everytimes ...
// But to be more feature proof - we should check that .-)