summaryrefslogtreecommitdiff
path: root/framework
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-01 17:00:16 +0200
commitc87170c8d3c206722a5b2bb2c2eb826abac06608 (patch)
treeeae9ca805bdc82114f481d24c9b478f671cf0e44 /framework
parent6f99f4f201e3bd9216d5ec46934473ba1ab0850c (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. Change-Id: Id5e780568fd60c38f4cee4ee800d747d65a31dae 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)
Diffstat (limited to 'framework')
-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 ca438acb1079..4935e3dd9277 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -52,16 +52,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 really!
+ // 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 .-)