diff options
Diffstat (limited to 'framework/source/dispatch/interceptionhelper.cxx')
-rw-r--r-- | framework/source/dispatch/interceptionhelper.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 9a98285ec720..bca143bc92a3 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -40,40 +40,40 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD const OUString& sTargetFrameName, sal_Int32 nSearchFlags ) { + css::uno::Reference<css::frame::XDispatchProvider> xInterceptor; // SAFE { - SolarMutexClearableGuard aReadLock; + { + SolarMutexGuard aReadLock; - // a) first search an interceptor, which match to this URL by its URL pattern registration - // Note: if it return NULL - it does not mean an empty interceptor list automatically! - css::uno::Reference< css::frame::XDispatchProvider > xInterceptor; - InterceptorList::const_iterator pIt = m_lInterceptionRegs.findByPattern(aURL.Complete); - if (pIt != m_lInterceptionRegs.end()) - xInterceptor = pIt->xInterceptor; + // a) first search an interceptor, which match to this URL by its URL pattern registration + // Note: if it return NULL - it does not mean an empty interceptor list automatically! + InterceptorList::const_iterator pIt = m_lInterceptionRegs.findByPattern(aURL.Complete); + if (pIt != m_lInterceptionRegs.end()) + xInterceptor = pIt->xInterceptor; - // b) No match by registration - but a valid interceptor list. - // Find first interceptor w/o pattern, so we need to query it - if (!xInterceptor.is()) - { - for (auto const& lInterceptionReg : m_lInterceptionRegs) + // b) No match by registration - but a valid interceptor list. + // Find first interceptor w/o pattern, so we need to query it + if (!xInterceptor.is()) { - if (!lInterceptionReg.lURLPattern.getLength()) + for (auto const& lInterceptionReg : m_lInterceptionRegs) { - // no pattern -> need to ask this guy! - xInterceptor = lInterceptionReg.xInterceptor; - break; + if (!lInterceptionReg.lURLPattern.getLength()) + { + // no pattern -> need to ask this guy! + xInterceptor = lInterceptionReg.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) } - // 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 .-) + if (!xInterceptor.is() && m_xSlave.is()) + xInterceptor = m_xSlave; } - // 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 .-) - if (!xInterceptor.is() && m_xSlave.is()) - xInterceptor = m_xSlave; - - aReadLock.clear(); // } SAFE css::uno::Reference< css::frame::XDispatch > xReturn; |