diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx index ca434f5fa8a8..7bfc1bfa2c06 100644 --- a/sdext/source/presenter/PresenterNotesView.cxx +++ b/sdext/source/presenter/PresenterNotesView.cxx @@ -378,7 +378,8 @@ void SAL_CALL PresenterNotesView::keyPressed (const awt::KeyEvent& rEvent) void SAL_CALL PresenterNotesView::keyReleased (const awt::KeyEvent&) {} sal_Int64 PresenterNotesView::getSomething(css::uno::Sequence const & aIdentifier) { - return comphelper::getSomethingImpl(aIdentifier, this); + return comphelper::getSomethingImpl( + aIdentifier, this, comphelper::FallbackToGetSomethingOf{}); } css::uno::Sequence const & PresenterNotesView::getUnoTunnelId() { diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index 132eaf35f85e..be4cc6a65d20 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -279,6 +279,10 @@ css::uno::Reference SAL_CALL PresenterSlideShowView::ge return mxCurrentSlide; } +sal_Int64 PresenterSlideShowView::getSomething(css::uno::Sequence const & aIdentifier) { + return CachablePresenterView::getSomething(aIdentifier); +} + //----- CachablePresenterView ------------------------------------------------- void PresenterSlideShowView::ReleaseView() diff --git a/sdext/source/presenter/PresenterSlideShowView.hxx b/sdext/source/presenter/PresenterSlideShowView.hxx index e4466522eddf..7f93e4b0e6e2 100644 --- a/sdext/source/presenter/PresenterSlideShowView.hxx +++ b/sdext/source/presenter/PresenterSlideShowView.hxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,8 @@ typedef cppu::WeakComponentImplHelper< css::awt::XMouseMotionListener, css::awt::XWindowListener, css::drawing::framework::XView, - css::drawing::XDrawView + css::drawing::XDrawView, + css::lang::XUnoTunnel > PresenterSlideShowViewInterfaceBase; /** Life view in a secondary window of a full screen slide show. @@ -166,6 +168,10 @@ public: virtual css::uno::Reference SAL_CALL getCurrentPage() override; + // XUnoTunnel + + sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; + // CachablePresenterView virtual void ActivatePresenterView() override; diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index ef33a4dde634..1b3fb0a1d753 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -612,6 +612,11 @@ Reference SAL_CALL PresenterSlideSorter::getCurrentPage() } +sal_Int64 PresenterSlideSorter::getSomething(css::uno::Sequence const & aIdentifier) { + return CachablePresenterView::getSomething(aIdentifier); +} + + void PresenterSlideSorter::UpdateLayout() { if ( ! mxWindow.is()) diff --git a/sdext/source/presenter/PresenterSlideSorter.hxx b/sdext/source/presenter/PresenterSlideSorter.hxx index 807bc439929e..7f1f3ac845d8 100644 --- a/sdext/source/presenter/PresenterSlideSorter.hxx +++ b/sdext/source/presenter/PresenterSlideSorter.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #include namespace sdext::presenter { @@ -50,7 +51,8 @@ typedef cppu::WeakComponentImplHelper< css::drawing::XSlidePreviewCacheListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, - css::drawing::XDrawView + css::drawing::XDrawView, + css::lang::XUnoTunnel > PresenterSlideSorterInterfaceBase; /** A simple slide sorter for the presenter screen. It uses a preview cache @@ -129,6 +131,10 @@ public: virtual css::uno::Reference SAL_CALL getCurrentPage() override; + // XUnoTunnel + + sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; + private: css::uno::Reference mxComponentContext; css::uno::Reference mxViewId; diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 867459423d8e..b095975680e4 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -575,6 +575,11 @@ Reference SAL_CALL PresenterToolBar::getCurrentPage() } +sal_Int64 PresenterToolBar::getSomething(css::uno::Sequence const & aIdentifier) { + return CachablePresenterView::getSomething(aIdentifier); +} + + void PresenterToolBar::CreateControls ( const OUString& rsConfigurationPath) { diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx index 1b789955689c..50937ea8d3bd 100644 --- a/sdext/source/presenter/PresenterToolBar.hxx +++ b/sdext/source/presenter/PresenterToolBar.hxx @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -44,7 +45,8 @@ typedef cppu::WeakComponentImplHelper< css::awt::XPaintListener, css::awt::XMouseListener, css::awt::XMouseMotionListener, - css::drawing::XDrawView + css::drawing::XDrawView, + css::lang::XUnoTunnel > PresenterToolBarInterfaceBase; typedef cppu::WeakComponentImplHelper< @@ -134,6 +136,10 @@ public: virtual css::uno::Reference SAL_CALL getCurrentPage() override; + // XUnoTunnel + + sal_Int64 SAL_CALL getSomething(css::uno::Sequence const & aIdentifier) override; + class Context; private: diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index 06eff32f7d3f..2768edf763ab 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -26,6 +26,7 @@ #include "PresenterSlideSorter.hxx" #include "PresenterToolBar.hxx" #include +#include #include using namespace ::com::sun::star; @@ -215,7 +216,7 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference& pDescriptor->SetActivationState(false); // Dispose only views that we can not put into the cache. - CachablePresenterView* pView = dynamic_cast(rxView.get()); + CachablePresenterView* pView = comphelper::getFromUnoTunnel(rxView); if (pView == nullptr || mpResourceCache == nullptr) { try @@ -271,7 +272,7 @@ Reference PresenterViewFactory::GetViewFromCache( if (iView->second.second == rxAnchorPane) { CachablePresenterView* pView - = dynamic_cast(iView->second.first.get()); + = comphelper::getFromUnoTunnel(iView->second.first); if (pView != nullptr) pView->ActivatePresenterView(); return iView->second.first; @@ -322,7 +323,7 @@ Reference PresenterViewFactory::CreateView( } // Activate it. - CachablePresenterView* pView = dynamic_cast(xView.get()); + CachablePresenterView* pView = comphelper::getFromUnoTunnel(xView); if (pView != nullptr) pView->ActivatePresenterView(); } @@ -480,6 +481,15 @@ void PresenterViewFactory::ThrowIfDisposed() const //===== CachablePresenterView ================================================= +sal_Int64 CachablePresenterView::getSomething(css::uno::Sequence const & id) { + return comphelper::getSomethingImpl(id, this); +} + +css::uno::Sequence const & CachablePresenterView::getUnoTunnelId() { + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + CachablePresenterView::CachablePresenterView() : mbIsPresenterViewActive(true) { diff --git a/sdext/source/presenter/PresenterViewFactory.hxx b/sdext/source/presenter/PresenterViewFactory.hxx index 7f3468d4e57a..32429c790cff 100644 --- a/sdext/source/presenter/PresenterViewFactory.hxx +++ b/sdext/source/presenter/PresenterViewFactory.hxx @@ -39,7 +39,7 @@ typedef ::cppu::WeakComponentImplHelper < /** Base class for presenter views that allows the view factory to store them in a cache and reuse deactivated views. */ -class SAL_LOPLUGIN_ANNOTATE("crosscast") CachablePresenterView +class CachablePresenterView { public: virtual void ActivatePresenterView(); @@ -55,6 +55,9 @@ public: */ virtual void ReleaseView(); + sal_Int64 getSomething(css::uno::Sequence const & id); + static css::uno::Sequence const & getUnoTunnelId(); + protected: bool mbIsPresenterViewActive;