summaryrefslogtreecommitdiff
path: root/framework/inc/dispatch/interceptionhelper.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/inc/dispatch/interceptionhelper.hxx')
-rw-r--r--framework/inc/dispatch/interceptionhelper.hxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/framework/inc/dispatch/interceptionhelper.hxx b/framework/inc/dispatch/interceptionhelper.hxx
index 7788559c7eff..89339b1f8455 100644
--- a/framework/inc/dispatch/interceptionhelper.hxx
+++ b/framework/inc/dispatch/interceptionhelper.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <rtl/ref.hxx>
#include <tools/wldcrd.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/weakref.hxx>
@@ -35,6 +36,8 @@
namespace framework{
+class DispatchProvider;
+
/** @short implements a helper to support interception with additional functionality.
@descr This helper implements the complete XDispatchProviderInterception interface with
@@ -97,23 +100,19 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper<
/** @short search for an interceptor inside this list using it's reference.
- @param xInterceptor
- points to the interceptor object, which should be located inside this list.
+ @param sURL
+ URL which should match with a registered pattern.
@return An iterator object, which points directly to the located item inside this list.
In case no interceptor could be found, it points to the end of this list!
*/
iterator findByPattern(std::u16string_view sURL)
{
- iterator pIt;
- for (pIt=begin(); pIt!=end(); ++pIt)
+ for (iterator pIt=begin(); pIt!=end(); ++pIt)
{
- sal_Int32 c = pIt->lURLPattern.getLength();
- const OUString* pPattern = pIt->lURLPattern.getConstArray();
-
- for (sal_Int32 i=0; i<c; ++i)
+ for (const OUString& pattern : pIt->lURLPattern)
{
- WildCard aPattern(pPattern[i]);
+ WildCard aPattern(pattern);
if (aPattern.Matches(sURL))
return pIt;
}
@@ -133,7 +132,7 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper<
/** @short this interception helper implements the top level master of an interceptor list ...
but this member is the lowest possible slave! */
- css::uno::Reference< css::frame::XDispatchProvider > m_xSlave;
+ rtl::Reference< DispatchProvider > m_xSlave;
/** @short contains all registered interceptor objects. */
InterceptorList m_lInterceptionRegs;
@@ -151,7 +150,7 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper<
an outside creates dispatch provider, which has to be used here as lowest slave "interceptor".
*/
InterceptionHelper(const css::uno::Reference< css::frame::XFrame >& xOwner,
- const css::uno::Reference< css::frame::XDispatchProvider >& xSlave);
+ rtl::Reference< DispatchProvider > xSlave);
private:
@@ -248,6 +247,8 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper<
*/
virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
+ rtl::Reference<DispatchProvider> GetSlave() const { return m_xSlave; }
+
}; // class InterceptionHelper
} // namespace framework