[API CHANGE] remove css::drawing::framework::XView

internal to sd, no need for it to use UNO

Change-Id: I17db2d5185051e551565361d29b9f890eb8d77a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186886
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2025-06-24 15:13:06 +02:00
parent bf326cd729
commit 380bd856d1
39 changed files with 303 additions and 321 deletions
-1
View File
@@ -2376,7 +2376,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing/framework,\
AnchorBindingMode \
XResource \
XResourceId \
XView \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/embed,\
Actions \
+1 -1
View File
@@ -225,7 +225,7 @@ excludelist:
sd/source/ui/inc/framework/ViewShellWrapper.hxx:
# base class has to be a complete type
- com/sun/star/awt/XWindowListener.hpp
- com/sun/star/drawing/framework/XView.hpp
- framework/XView.hxx
- com/sun/star/lang/XUnoTunnel.hpp
- com/sun/star/view/XSelectionSupplier.hpp
sd/source/ui/inc/tools/SlotStateListener.hxx:
-1
View File
@@ -204,7 +204,6 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
+2 -2
View File
@@ -39,7 +39,7 @@
#include <com/sun/star/accessibility/XAccessibleText.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <framework/AbstractPane.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/implbase.hxx>
@@ -146,7 +146,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy()
pPaneContainer->FindPaneURL(PresenterPaneFactory::msNotesPaneURL));
// Get the notes view.
Reference<drawing::framework::XView> xNotesView;
rtl::Reference<sd::framework::AbstractView> xNotesView;
if (pNotesPane)
xNotesView = pNotesPane->mxView;
rtl::Reference<PresenterNotesView> pNotesView (
+5 -5
View File
@@ -376,7 +376,7 @@ void PresenterController::UpdateViews()
// Tell all views about the slides they should display.
for (const auto& rxPane : mpPaneContainer->maPanes)
{
Reference<drawing::XDrawView> xDrawView (rxPane->mxView, UNO_QUERY);
Reference<drawing::XDrawView> xDrawView (cppu::getXWeak(rxPane->mxView.get()), UNO_QUERY);
if (xDrawView.is())
xDrawView->setCurrentPage(mxCurrentSlide);
}
@@ -690,7 +690,7 @@ void PresenterController::notifyConfigurationChange (
{
// A view bound to one of the panes has been created and is
// stored in the pane container along with its pane.
Reference<XView> xView (rEvent.ResourceObject,UNO_QUERY);
rtl::Reference<sd::framework::AbstractView> xView = dynamic_cast<sd::framework::AbstractView*>(rEvent.ResourceObject.get());
if (xView.is())
{
mpPaneContainer->StoreView(xView);
@@ -704,7 +704,7 @@ void PresenterController::notifyConfigurationChange (
if (rEvent.ResourceId->isBoundTo(mxMainPaneId,AnchorBindingMode_INDIRECT))
{
// If this is a view then remove it from the pane container.
Reference<XView> xView (rEvent.ResourceObject,UNO_QUERY);
rtl::Reference<sd::framework::AbstractView> xView = dynamic_cast<sd::framework::AbstractView*>(rEvent.ResourceObject.get());
if (xView.is())
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
@@ -769,7 +769,7 @@ void SAL_CALL PresenterController::keyPressed (const awt::KeyEvent& rEvent)
if ( ! rxPane->mbIsActive)
continue;
Reference<awt::XKeyListener> xKeyListener (rxPane->mxView, UNO_QUERY);
Reference<awt::XKeyListener> xKeyListener (cppu::getXWeak(rxPane->mxView.get()), UNO_QUERY);
if (xKeyListener.is())
xKeyListener->keyPressed(rEvent);
}
@@ -947,7 +947,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
if ( ! rxPane->mbIsActive)
continue;
Reference<awt::XKeyListener> xKeyListener (rxPane->mxView, UNO_QUERY);
Reference<awt::XKeyListener> xKeyListener (cppu::getXWeak(rxPane->mxView.get()), UNO_QUERY);
if (xKeyListener.is())
xKeyListener->keyReleased(rEvent);
}
+18 -18
View File
@@ -123,8 +123,7 @@ PresenterHelpView::PresenterHelpView (
const Reference<XResourceId>& rxViewId,
const rtl::Reference<::sd::DrawController>& rxController,
::rtl::Reference<PresenterController> xPresenterController)
: PresenterHelpViewInterfaceBase(m_aMutex),
mxComponentContext(rxContext),
: mxComponentContext(rxContext),
mxViewId(rxViewId),
mpPresenterController(std::move(xPresenterController)),
mnSeparatorY(0),
@@ -180,7 +179,7 @@ PresenterHelpView::~PresenterHelpView()
{
}
void SAL_CALL PresenterHelpView::disposing()
void PresenterHelpView::disposing(std::unique_lock<std::mutex>&)
{
mxViewId = nullptr;
@@ -217,24 +216,32 @@ void SAL_CALL PresenterHelpView::disposing (const lang::EventObject& rEventObjec
void SAL_CALL PresenterHelpView::windowResized (const awt::WindowEvent&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
Resize();
}
void SAL_CALL PresenterHelpView::windowMoved (const awt::WindowEvent&)
{
ThrowIfDisposed();
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
void SAL_CALL PresenterHelpView::windowShown (const lang::EventObject&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
Resize();
}
void SAL_CALL PresenterHelpView::windowHidden (const lang::EventObject&)
{
ThrowIfDisposed();
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
//----- XPaintListener --------------------------------------------------------
@@ -429,7 +436,10 @@ void PresenterHelpView::CheckFontSize()
Reference<XResourceId> SAL_CALL PresenterHelpView::getResourceId()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return mxViewId;
}
@@ -474,16 +484,6 @@ void PresenterHelpView::Resize()
CheckFontSize();
}
void PresenterHelpView::ThrowIfDisposed()
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
u"PresenterHelpView has been already disposed"_ustr,
static_cast<uno::XWeak*>(this));
}
}
//===== LineDescriptor =========================================================
namespace {
+6 -12
View File
@@ -21,11 +21,10 @@
#define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERHELPVIEW_HXX
#include "PresenterController.hxx"
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <com/sun/star/awt/XPaintListener.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <memory>
@@ -34,8 +33,8 @@ namespace sdext::presenter {
class PresenterButton;
typedef cppu::WeakComponentImplHelper<
css::drawing::framework::XView,
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView,
css::awt::XWindowListener,
css::awt::XPaintListener
> PresenterHelpViewInterfaceBase;
@@ -43,8 +42,7 @@ typedef cppu::WeakComponentImplHelper<
/** Show help text that describes the defined keys.
*/
class PresenterHelpView
: private ::cppu::BaseMutex,
public PresenterHelpViewInterfaceBase
: public PresenterHelpViewInterfaceBase
{
public:
explicit PresenterHelpView (
@@ -54,10 +52,11 @@ public:
::rtl::Reference<PresenterController> xPresenterController);
virtual ~PresenterHelpView() override;
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
// lang::XEventListener
using WeakComponentImplHelperBase::disposing;
virtual void SAL_CALL
disposing (const css::lang::EventObject& rEventObject) override;
@@ -107,11 +106,6 @@ private:
time.
*/
void CheckFontSize();
/** @throws css::lang::DisposedException when the object has already been
disposed.
*/
void ThrowIfDisposed();
};
} // end of namespace ::sdext::presenter
+8 -8
View File
@@ -55,8 +55,7 @@ PresenterNotesView::PresenterNotesView (
const Reference<XResourceId>& rxViewId,
const ::rtl::Reference<::sd::DrawController>& rxController,
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterNotesViewInterfaceBase(m_aMutex),
mxViewId(rxViewId),
: mxViewId(rxViewId),
mpPresenterController(rpPresenterController),
maSeparatorColor(0xffffff),
mnSeparatorYLocation(0),
@@ -112,7 +111,10 @@ PresenterNotesView::PresenterNotesView (
}
catch (RuntimeException&)
{
PresenterNotesView::disposing();
{
std::unique_lock l(m_aMutex);
PresenterNotesView::disposing(l);
}
throw;
}
}
@@ -121,7 +123,7 @@ PresenterNotesView::~PresenterNotesView()
{
}
void SAL_CALL PresenterNotesView::disposing()
void PresenterNotesView::disposing(std::unique_lock<std::mutex>&)
{
if (mxParentWindow.is())
{
@@ -270,11 +272,9 @@ void SAL_CALL PresenterNotesView::windowHidden (const lang::EventObject&) {}
void SAL_CALL PresenterNotesView::windowPaint (const awt::PaintEvent& rEvent)
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
u"PresenterNotesView object has already been disposed"_ustr,
static_cast<uno::XWeak*>(this));
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
if ( ! mbIsPresenterViewActive)
+6 -6
View File
@@ -28,7 +28,7 @@
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <rtl/ref.hxx>
@@ -42,10 +42,10 @@ class PresenterButton;
class PresenterScrollBar;
class PresenterTextView;
typedef cppu::WeakComponentImplHelper<
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView,
css::awt::XWindowListener,
css::awt::XPaintListener,
css::drawing::framework::XView,
css::drawing::XDrawView,
css::awt::XKeyListener
> PresenterNotesViewInterfaceBase;
@@ -55,8 +55,7 @@ typedef cppu::WeakComponentImplHelper<
notes text.
*/
class PresenterNotesView
: private ::cppu::BaseMutex,
public PresenterNotesViewInterfaceBase,
: public PresenterNotesViewInterfaceBase,
public CachablePresenterView
{
public:
@@ -67,7 +66,7 @@ public:
const ::rtl::Reference<PresenterController>& rpPresenterController);
virtual ~PresenterNotesView() override;
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
/** Typically called from setCurrentSlide() with the notes page that is
associated with the slide given to setCurrentSlide().
@@ -84,6 +83,7 @@ public:
// lang::XEventListener
using WeakComponentImplHelperBase::disposing;
virtual void SAL_CALL
disposing (const css::lang::EventObject& rEventObject) override;
+2 -2
View File
@@ -137,7 +137,7 @@ PresenterPaneContainer::SharedPaneDescriptor
PresenterPaneContainer::SharedPaneDescriptor
PresenterPaneContainer::StoreView (
const Reference<XView>& rxView)
const rtl::Reference<sd::framework::AbstractView>& rxView)
{
SharedPaneDescriptor pDescriptor;
@@ -189,7 +189,7 @@ PresenterPaneContainer::SharedPaneDescriptor
}
PresenterPaneContainer::SharedPaneDescriptor
PresenterPaneContainer::RemoveView (const Reference<XView>& rxView)
PresenterPaneContainer::RemoveView (const rtl::Reference<sd::framework::AbstractView>& rxView)
{
SharedPaneDescriptor pDescriptor;
+5 -5
View File
@@ -24,7 +24,7 @@
#include <PresenterHelper.hxx>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
@@ -56,7 +56,7 @@ public:
virtual void SAL_CALL disposing() override;
typedef ::std::function<void (const css::uno::Reference<css::drawing::framework::XView>&)>
typedef ::std::function<void (const rtl::Reference<sd::framework::AbstractView>&)>
ViewInitializationFunction;
/** Each pane descriptor holds references to one pane and the view
@@ -73,7 +73,7 @@ public:
css::uno::Reference<css::drawing::framework::XResourceId> mxPaneId;
OUString msViewURL;
::rtl::Reference<PresenterPaneBase> mxPane;
css::uno::Reference<css::drawing::framework::XView> mxView;
rtl::Reference<sd::framework::AbstractView> mxView;
css::uno::Reference<css::awt::XWindow> mxContentWindow;
css::uno::Reference<css::awt::XWindow> mxBorderWindow;
OUString msTitleTemplate;
@@ -107,13 +107,13 @@ public:
const css::uno::Reference<css::awt::XWindow>& rxBorderWindow);
SharedPaneDescriptor StoreView (
const css::uno::Reference<css::drawing::framework::XView>& rxView);
const rtl::Reference<sd::framework::AbstractView>& rxView);
SharedPaneDescriptor RemovePane (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId);
SharedPaneDescriptor RemoveView (
const css::uno::Reference<css::drawing::framework::XView>& rxView);
const rtl::Reference<sd::framework::AbstractView>& rxView);
/** Find the pane whose border window is identical to the given border
window.
+22 -18
View File
@@ -45,8 +45,7 @@ PresenterSlidePreview::PresenterSlidePreview (
const Reference<XResourceId>& rxViewId,
const rtl::Reference<sd::framework::AbstractPane>& rxAnchorPane,
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterSlidePreviewInterfaceBase(m_aMutex),
mpPresenterController(rpPresenterController),
: mpPresenterController(rpPresenterController),
mxViewId(rxViewId),
mnSlideAspectRatio(28.0 / 21.0)
{
@@ -93,7 +92,7 @@ PresenterSlidePreview::~PresenterSlidePreview()
{
}
void SAL_CALL PresenterSlidePreview::disposing()
void PresenterSlidePreview::disposing(std::unique_lock<std::mutex>&)
{
if (mxWindow.is())
{
@@ -123,7 +122,10 @@ sal_Bool SAL_CALL PresenterSlidePreview::isAnchorOnly()
void SAL_CALL PresenterSlidePreview::windowResized (const awt::WindowEvent&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
Resize();
}
@@ -132,7 +134,10 @@ void SAL_CALL PresenterSlidePreview::windowMoved (const awt::WindowEvent&) {}
void SAL_CALL PresenterSlidePreview::windowShown (const lang::EventObject&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
Resize();
}
@@ -143,7 +148,10 @@ void SAL_CALL PresenterSlidePreview::windowHidden (const lang::EventObject&) {}
void SAL_CALL PresenterSlidePreview::windowPaint (const awt::PaintEvent& rEvent)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
if (mxWindow.is())
@@ -170,14 +178,20 @@ void SAL_CALL PresenterSlidePreview::disposing (const lang::EventObject& rEvent)
void SAL_CALL PresenterSlidePreview::setCurrentPage (const Reference<drawing::XDrawPage>& rxSlide)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
SetSlide(rxSlide);
}
Reference<drawing::XDrawPage> SAL_CALL PresenterSlidePreview::getCurrentPage()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return nullptr;
}
@@ -332,16 +346,6 @@ void PresenterSlidePreview::Resize()
SetSlide(mxCurrentSlide);
}
void PresenterSlidePreview::ThrowIfDisposed()
{
if (PresenterSlidePreviewInterfaceBase::rBHelper.bDisposed || PresenterSlidePreviewInterfaceBase::rBHelper.bInDispose)
{
throw lang::DisposedException (
u"PresenterSlidePreview object has already been disposed"_ustr,
static_cast<uno::XWeak*>(this));
}
}
} // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+7 -12
View File
@@ -28,16 +28,15 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <framework/AbstractPane.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <rtl/ref.hxx>
namespace sdext::presenter {
typedef ::cppu::WeakComponentImplHelper <
css::drawing::framework::XView,
typedef ::cppu::ImplInheritanceHelper <
sd::framework::AbstractView,
css::drawing::XDrawView,
css::awt::XPaintListener,
css::awt::XWindowListener
@@ -50,8 +49,7 @@ typedef ::cppu::WeakComponentImplHelper <
uses a derived class that overrides the setCurrentSlide() method.
*/
class PresenterSlidePreview
: private ::cppu::BaseMutex,
public PresenterSlidePreviewInterfaceBase
: public PresenterSlidePreviewInterfaceBase
{
public:
PresenterSlidePreview (
@@ -60,9 +58,11 @@ public:
const rtl::Reference<sd::framework::AbstractPane>& rxAnchorPane,
const ::rtl::Reference<PresenterController>& rpPresenterController);
virtual ~PresenterSlidePreview() override;
PresenterSlidePreview(const PresenterSlidePreview&) = delete;
PresenterSlidePreview& operator=(const PresenterSlidePreview&) = delete;
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
// XResourceId
@@ -131,11 +131,6 @@ private:
/** React to a resize of the anchor pane.
*/
void Resize();
/** @throws css::lang::DisposedException when the object has already been
disposed.
*/
void ThrowIfDisposed();
};
} // end of namespace ::sd::presenter
+73 -88
View File
@@ -80,15 +80,13 @@ PresenterSlideShowView::PresenterSlideShowView (
css::uno::Reference<css::drawing::framework::XResourceId> xViewId,
const rtl::Reference<::sd::DrawController>& rxController,
::rtl::Reference<PresenterController> xPresenterController)
: PresenterSlideShowViewInterfaceBase(m_aMutex),
mxComponentContext(std::move(xContext)),
: mxComponentContext(std::move(xContext)),
mpPresenterController(std::move(xPresenterController)),
mxViewId(std::move(xViewId)),
mxController(rxController),
mxSlideShowController(lcl_GetSlideShowController(rxController)),
mbIsViewAdded(false),
mnPageAspectRatio(28.0/21.0),
maBroadcaster(m_aMutex),
mbIsForcedPaintPending(false),
mbIsPaintPending(true),
mbIsEndSlideVisible(false)
@@ -178,16 +176,19 @@ PresenterSlideShowView::~PresenterSlideShowView()
{
}
void PresenterSlideShowView::disposing()
void PresenterSlideShowView::disposing(std::unique_lock<std::mutex>&)
{
// Tell all listeners that we are disposed.
lang::EventObject aEvent;
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<lang::XEventListener>::get());
if (pIterator != nullptr)
pIterator->disposeAndClear(aEvent);
{
std::unique_lock l(m_aMutex);
maMouseListeners.disposeAndClear(l, aEvent);
maMouseMotionListeners.disposeAndClear(l, aEvent);
maPaintListeners.disposeAndClear(l, aEvent);
maModifyListeners.disposeAndClear(l, aEvent);
}
// Do this for
// XPaintListener, XModifyListener,XMouseListener,XMouseMotionListener,XWindowListener?
@@ -314,14 +315,20 @@ void PresenterSlideShowView::ReleaseView()
Reference<rendering::XSpriteCanvas> SAL_CALL PresenterSlideShowView::getCanvas()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return Reference<rendering::XSpriteCanvas>(mxViewCanvas, UNO_QUERY);
}
void SAL_CALL PresenterSlideShowView::clear()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
mbIsForcedPaintPending = false;
mbIsPaintPending = false;
@@ -348,7 +355,10 @@ void SAL_CALL PresenterSlideShowView::clear()
geometry::AffineMatrix2D SAL_CALL PresenterSlideShowView::getTransformation()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
if (mxViewWindow.is())
{
@@ -374,85 +384,83 @@ geometry::AffineMatrix2D SAL_CALL PresenterSlideShowView::getTransformation()
geometry::IntegerSize2D SAL_CALL PresenterSlideShowView::getTranslationOffset()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return geometry::IntegerSize2D(0,0);
}
void SAL_CALL PresenterSlideShowView::addTransformationChangedListener(
const Reference<util::XModifyListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.addListener(
cppu::UnoType<util::XModifyListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maModifyListeners.addInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::removeTransformationChangedListener(
const Reference<util::XModifyListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.removeListener(
cppu::UnoType<util::XModifyListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maModifyListeners.removeInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::addPaintListener(
const Reference<awt::XPaintListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.addListener(
cppu::UnoType<awt::XPaintListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maPaintListeners.addInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::removePaintListener(
const Reference<awt::XPaintListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.removeListener(
cppu::UnoType<awt::XPaintListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maPaintListeners.removeInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::addMouseListener(
const Reference<awt::XMouseListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.addListener(
cppu::UnoType<awt::XMouseListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maMouseListeners.addInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::removeMouseListener(
const Reference<awt::XMouseListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.removeListener(
cppu::UnoType<awt::XMouseListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maMouseListeners.removeInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::addMouseMotionListener(
const Reference<awt::XMouseMotionListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.addListener(
cppu::UnoType<awt::XMouseMotionListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maMouseMotionListeners.addInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::removeMouseMotionListener(
const Reference<awt::XMouseMotionListener>& rxListener)
{
ThrowIfDisposed();
maBroadcaster.removeListener(
cppu::UnoType<awt::XMouseMotionListener>::get(),
rxListener);
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
maMouseMotionListeners.removeInterface(l, rxListener);
}
void SAL_CALL PresenterSlideShowView::setMouseCursor(::sal_Int16 nPointerShape)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
// Create a pointer when it does not yet exist.
if ( ! mxPointer.is())
@@ -518,11 +526,9 @@ void SAL_CALL PresenterSlideShowView::mousePressed (const awt::MouseEvent& rEven
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseListener::mousePressed, aEvent);
std::unique_lock l(m_aMutex);
maMouseListeners.notifyEach(l, &awt::XMouseListener::mousePressed, aEvent);
}
// Only when the end slide is displayed we forward the mouse event to
@@ -537,11 +543,9 @@ void SAL_CALL PresenterSlideShowView::mouseReleased (const awt::MouseEvent& rEve
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseListener::mouseReleased, aEvent);
std::unique_lock l(m_aMutex);
maMouseListeners.notifyEach(l, &awt::XMouseListener::mouseReleased, aEvent);
}
}
@@ -549,11 +553,9 @@ void SAL_CALL PresenterSlideShowView::mouseEntered (const awt::MouseEvent& rEven
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseListener::mouseEntered, aEvent);
std::unique_lock l(m_aMutex);
maMouseListeners.notifyEach(l, &awt::XMouseListener::mouseEntered, aEvent);
}
}
@@ -561,11 +563,9 @@ void SAL_CALL PresenterSlideShowView::mouseExited (const awt::MouseEvent& rEvent
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseListener::mouseExited, aEvent);
std::unique_lock l(m_aMutex);
maMouseListeners.notifyEach(l, &awt::XMouseListener::mouseExited, aEvent);
}
}
@@ -575,11 +575,9 @@ void SAL_CALL PresenterSlideShowView::mouseDragged (const awt::MouseEvent& rEven
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseMotionListener::mouseDragged, aEvent);
std::unique_lock l(m_aMutex);
maMouseMotionListeners.notifyEach(l, &awt::XMouseMotionListener::mouseDragged, aEvent);
}
}
@@ -587,11 +585,9 @@ void SAL_CALL PresenterSlideShowView::mouseMoved (const awt::MouseEvent& rEvent)
{
awt::MouseEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XMouseMotionListener::mouseMoved, aEvent);
std::unique_lock l(m_aMutex);
maMouseMotionListeners.notifyEach(l, &awt::XMouseMotionListener::mouseMoved, aEvent);
}
}
@@ -599,7 +595,10 @@ void SAL_CALL PresenterSlideShowView::mouseMoved (const awt::MouseEvent& rEvent)
void SAL_CALL PresenterSlideShowView::windowResized (const awt::WindowEvent&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
Resize();
@@ -773,11 +772,9 @@ void PresenterSlideShowView::PaintInnerWindow (const awt::PaintEvent& rEvent)
// Forward window paint to listeners.
awt::PaintEvent aEvent (rEvent);
aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XPaintListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&awt::XPaintListener::windowPaint, aEvent);
std::unique_lock l(m_aMutex);
maPaintListeners.notifyEach(l, &awt::XPaintListener::windowPaint, aEvent);
}
/** The slide show relies on the back buffer of the canvas not being
@@ -885,11 +882,9 @@ void PresenterSlideShowView::Resize()
// Notify listeners that the transformation that maps the view into the
// window has changed.
lang::EventObject aEvent (static_cast<XWeak*>(this));
::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<util::XModifyListener>::get());
if (pIterator != nullptr)
{
pIterator->notifyEach(&util::XModifyListener::modified, aEvent);
std::unique_lock l(m_aMutex);
maModifyListeners.notifyEach(l, &util::XModifyListener::modified, aEvent);
}
// Due to constant aspect ratio resizing may lead a preview that changes
@@ -946,16 +941,6 @@ void PresenterSlideShowView::CreateBackgroundPolygons()
}
}
void PresenterSlideShowView::ThrowIfDisposed()
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
u"PresenterSlideShowView object has already been disposed"_ustr,
static_cast<uno::XWeak*>(this));
}
}
void PresenterSlideShowView::impl_addAndConfigureView()
{
Reference<presentation::XSlideShowView> xView (this);
+10 -13
View File
@@ -30,31 +30,30 @@
#include <com/sun/star/drawing/XDrawView.hpp>
#include <framework/AbstractPane.hxx>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/presentation/XSlideShowController.hpp>
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <comphelper/interfacecontainer4.hxx>
namespace sdext::presenter {
typedef cppu::WeakComponentImplHelper<
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView,
css::presentation::XSlideShowView,
css::awt::XPaintListener,
css::awt::XMouseListener,
css::awt::XMouseMotionListener,
css::awt::XWindowListener,
css::drawing::framework::XView,
css::drawing::XDrawView
> PresenterSlideShowViewInterfaceBase;
/** Life view in a secondary window of a full screen slide show.
*/
class PresenterSlideShowView
: protected ::cppu::BaseMutex,
public PresenterSlideShowViewInterfaceBase,
: public PresenterSlideShowViewInterfaceBase,
public CachablePresenterView
{
public:
@@ -68,7 +67,7 @@ public:
PresenterSlideShowView& operator=(const PresenterSlideShowView&) = delete;
void LateInit();
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
// CachablePresenterView
@@ -196,7 +195,10 @@ private:
/** This broadcast helper is used to notify listeners registered to a
SlideShowView object.
*/
::cppu::OBroadcastHelper maBroadcaster;
comphelper::OInterfaceContainerHelper4<css::awt::XMouseListener> maMouseListeners;
comphelper::OInterfaceContainerHelper4<css::awt::XMouseMotionListener> maMouseMotionListeners;
comphelper::OInterfaceContainerHelper4<css::awt::XPaintListener> maPaintListeners;
comphelper::OInterfaceContainerHelper4<css::util::XModifyListener> maModifyListeners;
SharedBitmapDescriptor mpBackground;
@@ -225,11 +227,6 @@ private:
void CreateBackgroundPolygons();
/** @throws css::lang::DisposedException when the object has already been
disposed.
*/
void ThrowIfDisposed();
void impl_addAndConfigureView();
};
+30 -21
View File
@@ -230,8 +230,7 @@ PresenterSlideSorter::PresenterSlideSorter (
const Reference<XResourceId>& rxViewId,
const rtl::Reference<::sd::DrawController>& rxController,
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterSlideSorterInterfaceBase(m_aMutex),
mxComponentContext(rxContext),
: mxComponentContext(rxContext),
mxViewId(rxViewId),
mpPresenterController(rpPresenterController),
mxSlideShowController(mpPresenterController->GetSlideShowController()),
@@ -328,7 +327,10 @@ PresenterSlideSorter::PresenterSlideSorter (
}
catch (RuntimeException&)
{
disposing();
{
std::unique_lock l(m_aMutex);
disposing(l);
}
throw;
}
}
@@ -337,7 +339,7 @@ PresenterSlideSorter::~PresenterSlideSorter()
{
}
void SAL_CALL PresenterSlideSorter::disposing()
void PresenterSlideSorter::disposing(std::unique_lock<std::mutex>&)
{
mxComponentContext = nullptr;
mxViewId = nullptr;
@@ -412,26 +414,34 @@ void SAL_CALL PresenterSlideSorter::disposing (const lang::EventObject& rEventOb
void SAL_CALL PresenterSlideSorter::windowResized (const awt::WindowEvent&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
mbIsLayoutPending = true;
mpPresenterController->GetPaintManager()->Invalidate(mxWindow);
}
void SAL_CALL PresenterSlideSorter::windowMoved (const awt::WindowEvent&)
{
ThrowIfDisposed();
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
void SAL_CALL PresenterSlideSorter::windowShown (const lang::EventObject&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
mbIsLayoutPending = true;
mpPresenterController->GetPaintManager()->Invalidate(mxWindow);
}
void SAL_CALL PresenterSlideSorter::windowHidden (const lang::EventObject&)
{
ThrowIfDisposed();
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
//----- XPaintListener --------------------------------------------------------
@@ -537,7 +547,10 @@ void SAL_CALL PresenterSlideSorter::mouseDragged (const css::awt::MouseEvent&) {
Reference<XResourceId> SAL_CALL PresenterSlideSorter::getResourceId()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return mxViewId;
}
@@ -567,7 +580,10 @@ void SAL_CALL PresenterSlideSorter::notifyPreviewCreation (
void SAL_CALL PresenterSlideSorter::setCurrentPage (const Reference<drawing::XDrawPage>&)
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
if (!mxSlideShowController.is())
@@ -598,7 +614,10 @@ void SAL_CALL PresenterSlideSorter::setCurrentPage (const Reference<drawing::XDr
Reference<drawing::XDrawPage> SAL_CALL PresenterSlideSorter::getCurrentPage()
{
ThrowIfDisposed();
{
std::unique_lock l(m_aMutex);
throwIfDisposed(l);
}
return nullptr;
}
@@ -1042,16 +1061,6 @@ bool PresenterSlideSorter::ProvideCanvas()
return mxCanvas.is();
}
void PresenterSlideSorter::ThrowIfDisposed()
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
u"PresenterSlideSorter has been already disposed"_ustr,
static_cast<uno::XWeak*>(this));
}
}
//===== PresenterSlideSorter::Layout ==========================================
PresenterSlideSorter::Layout::Layout (
+6 -12
View File
@@ -25,13 +25,12 @@
#include "PresenterPaneContainer.hxx"
#include "PresenterViewFactory.hxx"
#include <PresenterPreviewCache.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <com/sun/star/awt/XPaintListener.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/geometry/RealRectangle2D.hpp>
@@ -42,8 +41,8 @@ namespace sdext::presenter {
class PresenterButton;
class PresenterScrollBar;
typedef cppu::WeakComponentImplHelper<
css::drawing::framework::XView,
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView,
css::awt::XWindowListener,
css::awt::XPaintListener,
css::beans::XPropertyChangeListener,
@@ -57,8 +56,7 @@ typedef cppu::WeakComponentImplHelper<
to create the slide previews. Painting is done via a canvas.
*/
class PresenterSlideSorter
: private ::cppu::BaseMutex,
public PresenterSlideSorterInterfaceBase,
: public PresenterSlideSorterInterfaceBase,
public CachablePresenterView
{
public:
@@ -69,10 +67,11 @@ public:
const ::rtl::Reference<PresenterController>& rpPresenterController);
virtual ~PresenterSlideSorter() override;
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
// lang::XEventListener
using WeakComponentImplHelperBase::disposing;
virtual void SAL_CALL
disposing (const css::lang::EventObject& rEventObject) override;
@@ -176,11 +175,6 @@ private:
void GotoSlide (const sal_Int32 nSlideIndex);
void ScrollSlideIntoView(sal_Int32 nSlideIndex);
bool ProvideCanvas();
/** @throws css::lang::DisposedException when the object has already been
disposed.
*/
void ThrowIfDisposed();
};
} // end of namespace ::sdext::presenter
+2 -3
View File
@@ -926,8 +926,7 @@ PresenterToolBarView::PresenterToolBarView (
const Reference<XResourceId>& rxViewId,
const rtl::Reference<::sd::DrawController>& rxController,
const ::rtl::Reference<PresenterController>& rpPresenterController)
: PresenterToolBarViewInterfaceBase(m_aMutex),
mxViewId(rxViewId),
: mxViewId(rxViewId),
mpPresenterController(rpPresenterController)
{
try
@@ -968,7 +967,7 @@ PresenterToolBarView::~PresenterToolBarView()
{
}
void SAL_CALL PresenterToolBarView::disposing()
void PresenterToolBarView::disposing(std::unique_lock<std::mutex>&)
{
rtl::Reference<PresenterToolBar> xComponent = std::move(mpToolBar);
if (xComponent.is())
+6 -6
View File
@@ -31,7 +31,7 @@
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/drawing/framework/XResourceId.hpp>
#include <com/sun/star/frame/XController.hpp>
@@ -47,9 +47,9 @@ typedef cppu::WeakComponentImplHelper<
css::drawing::XDrawView
> PresenterToolBarInterfaceBase;
typedef cppu::WeakComponentImplHelper<
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView,
css::awt::XPaintListener,
css::drawing::framework::XView,
css::drawing::XDrawView
> PresenterToolBarViewInterfaceBase;
@@ -188,8 +188,7 @@ private:
/** View for the PresenterToolBar.
*/
class PresenterToolBarView
: private ::cppu::BaseMutex,
public PresenterToolBarViewInterfaceBase
: public PresenterToolBarViewInterfaceBase
{
public:
explicit PresenterToolBarView (
@@ -201,7 +200,7 @@ public:
PresenterToolBarView(const PresenterToolBarView&) = delete;
PresenterToolBarView& operator=(const PresenterToolBarView&) = delete;
virtual void SAL_CALL disposing() override;
virtual void disposing(std::unique_lock<std::mutex>&) override;
const ::rtl::Reference<PresenterToolBar>& GetPresenterToolBar() const;
@@ -211,6 +210,7 @@ public:
// lang::XEventListener
using WeakComponentImplHelperBase::disposing;
virtual void SAL_CALL
disposing (const css::lang::EventObject& rEventObject) override;
+20 -23
View File
@@ -160,9 +160,8 @@ void PresenterViewFactory::disposing(std::unique_lock<std::mutex>&)
{
try
{
Reference<lang::XComponent> xComponent (rView.second.first, UNO_QUERY);
if (xComponent.is())
xComponent->dispose();
if (rView.second.first.is())
rView.second.first->dispose();
}
catch (lang::DisposedException&)
{
@@ -246,7 +245,7 @@ void PresenterViewFactory::releaseResource (const Reference<XResource>& rxView)
rtl::Reference<sd::framework::AbstractPane> xAnchorPane = dynamic_cast<sd::framework::AbstractPane*>(
mxConfigurationController->getResource(xViewId->getAnchor()).get());
(*mpResourceCache)[xViewId->getResourceURL()]
= ViewResourceDescriptor(Reference<XView>(rxView, UNO_QUERY), xAnchorPane);
= ViewResourceDescriptor(dynamic_cast<sd::framework::AbstractView*>(rxView.get()), xAnchorPane);
pView->DeactivatePresenterView();
}
}
@@ -293,7 +292,7 @@ Reference<XResource> PresenterViewFactory::CreateView(
const Reference<XResourceId>& rxViewId,
const rtl::Reference<sd::framework::AbstractPane>& rxAnchorPane)
{
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
try
{
@@ -337,7 +336,7 @@ Reference<XResource> PresenterViewFactory::CreateView(
return xView;
}
Reference<XView> PresenterViewFactory::CreateSlideShowView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateSlideShowView(
const Reference<XResourceId>& rxViewId) const
{
if ( ! mxConfigurationController.is())
@@ -363,11 +362,11 @@ Reference<XView> PresenterViewFactory::CreateSlideShowView(
}
}
Reference<XView> PresenterViewFactory::CreateSlidePreviewView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateSlidePreviewView(
const Reference<XResourceId>& rxViewId,
const rtl::Reference<sd::framework::AbstractPane>& rxAnchorPane) const
{
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
if ( ! mxConfigurationController.is())
return xView;
@@ -376,13 +375,12 @@ Reference<XView> PresenterViewFactory::CreateSlidePreviewView(
try
{
xView.set(
static_cast<XWeak*>(new NextSlidePreview(
xView =
new NextSlidePreview(
mxComponentContext,
rxViewId,
rxAnchorPane,
mpPresenterController)),
UNO_QUERY_THROW);
mpPresenterController);
}
catch (RuntimeException&)
{
@@ -392,7 +390,7 @@ Reference<XView> PresenterViewFactory::CreateSlidePreviewView(
return xView;
}
Reference<XView> PresenterViewFactory::CreateToolBarView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateToolBarView(
const Reference<XResourceId>& rxViewId) const
{
return new PresenterToolBarView(
@@ -402,10 +400,10 @@ Reference<XView> PresenterViewFactory::CreateToolBarView(
mpPresenterController);
}
Reference<XView> PresenterViewFactory::CreateNotesView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateNotesView(
const Reference<XResourceId>& rxViewId) const
{
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
if ( ! mxConfigurationController.is())
return xView;
@@ -414,13 +412,12 @@ Reference<XView> PresenterViewFactory::CreateNotesView(
try
{
xView.set(static_cast<XWeak*>(
xView =
new PresenterNotesView(
mxComponentContext,
rxViewId,
mxControllerWeak.get(),
mpPresenterController)),
UNO_QUERY_THROW);
mpPresenterController);
}
catch (RuntimeException&)
{
@@ -430,10 +427,10 @@ Reference<XView> PresenterViewFactory::CreateNotesView(
return xView;
}
Reference<XView> PresenterViewFactory::CreateSlideSorterView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateSlideSorterView(
const Reference<XResourceId>& rxViewId) const
{
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
if ( ! mxConfigurationController.is())
return xView;
@@ -458,14 +455,14 @@ Reference<XView> PresenterViewFactory::CreateSlideSorterView(
return xView;
}
Reference<XView> PresenterViewFactory::CreateHelpView(
rtl::Reference<sd::framework::AbstractView> PresenterViewFactory::CreateHelpView(
const Reference<XResourceId>& rxViewId) const
{
return Reference<XView>(new PresenterHelpView(
return new PresenterHelpView(
mxComponentContext,
rxViewId,
mxControllerWeak.get(),
mpPresenterController));
mpPresenterController);
}
//===== CachablePresenterView =================================================
+8 -8
View File
@@ -22,7 +22,7 @@
#include "PresenterController.hxx"
#include <framework/ResourceFactory.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <unotools/weakref.hxx>
#include <rtl/ref.hxx>
@@ -108,7 +108,7 @@ private:
rtl::Reference<sd::framework::ConfigurationController> mxConfigurationController;
unotools::WeakReference<::sd::DrawController> mxControllerWeak;
::rtl::Reference<PresenterController> mpPresenterController;
typedef ::std::pair<css::uno::Reference<css::drawing::framework::XView>,
typedef ::std::pair<rtl::Reference<sd::framework::AbstractView>,
rtl::Reference<sd::framework::AbstractPane> > ViewResourceDescriptor;
typedef ::std::map<OUString, ViewResourceDescriptor> ResourceContainer;
std::unique_ptr<ResourceContainer> mpResourceCache;
@@ -120,23 +120,23 @@ private:
void Register (const ::rtl::Reference<::sd::DrawController>& rxController);
css::uno::Reference<css::drawing::framework::XView> CreateSlideShowView(
rtl::Reference<sd::framework::AbstractView> CreateSlideShowView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateSlidePreviewView(
rtl::Reference<sd::framework::AbstractView> CreateSlidePreviewView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId,
const rtl::Reference<sd::framework::AbstractPane>& rxPane) const;
css::uno::Reference<css::drawing::framework::XView> CreateToolBarView(
rtl::Reference<sd::framework::AbstractView> CreateToolBarView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateNotesView(
rtl::Reference<sd::framework::AbstractView> CreateNotesView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateSlideSorterView(
rtl::Reference<sd::framework::AbstractView> CreateSlideSorterView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XView> CreateHelpView(
rtl::Reference<sd::framework::AbstractView> CreateHelpView(
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId) const;
css::uno::Reference<css::drawing::framework::XResource> GetViewFromCache (
+1 -1
View File
@@ -141,7 +141,7 @@ void PresenterWindowManager::SetTheme (const std::shared_ptr<PresenterTheme>& rp
}
}
void PresenterWindowManager::NotifyViewCreation (const Reference<XView>& rxView)
void PresenterWindowManager::NotifyViewCreation (const rtl::Reference<sd::framework::AbstractView>& rxView)
{
PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindPaneId(rxView->getResourceId()->getAnchor()));
+1 -1
View File
@@ -70,7 +70,7 @@ public:
void SetParentPane (const rtl::Reference<sd::framework::AbstractPane>& rxPane);
void SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme);
void NotifyViewCreation (const css::uno::Reference<css::drawing::framework::XView>& rxView);
void NotifyViewCreation (const rtl::Reference<sd::framework::AbstractView>& rxView);
void SetPanePosSizeAbsolute (
const OUString& rsPaneURL,
const double nX,
@@ -22,6 +22,7 @@
#include <framework/FrameworkHelper.hxx>
#include <framework/ConfigurationController.hxx>
#include <framework/AbstractPane.hxx>
#include <framework/AbstractView.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -283,6 +284,8 @@ ConfigurationChangeRequest::~ConfigurationChangeRequest() {}
AbstractPane::~AbstractPane() {}
AbstractView::~AbstractView() {}
} // end of namespace sd::framework
@@ -21,9 +21,8 @@
#include <framework/ConfigurationController.hxx>
#include <DrawController.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/compbase.hxx>
#include <comphelper/diagnose_ex.hxx>
#include <slideshow.hxx>
@@ -39,14 +38,11 @@ namespace sd::framework {
namespace {
typedef comphelper::WeakComponentImplHelper<XView> PresentationViewInterfaceBase;
/** The PresentationView is not an actual view, it is a marker whose
existence in a configuration indicates that a slideshow is running
(in another application window).
*/
class PresentationView
: public PresentationViewInterfaceBase
class PresentationView : public AbstractView
{
public:
explicit PresentationView (const Reference<XResourceId>& rxViewId)
@@ -117,9 +117,9 @@ void CenterViewFocusModule::HandleNewView (
FrameworkHelper::CreateResourceId(FrameworkHelper::msCenterPaneURL),
FrameworkHelper::msViewURLPrefix,
AnchorBindingMode_DIRECT));
Reference<XView> xView;
rtl::Reference<AbstractView> xView;
if (xViewIds.hasElements())
xView.set( mxConfigurationController->getResource(xViewIds[0]),UNO_QUERY);
xView = dynamic_cast<AbstractView*>( mxConfigurationController->getResource(xViewIds[0]).get() );
if (mpBase!=nullptr)
{
auto pViewShellWrapper = dynamic_cast<ViewShellWrapper*>(xView.get());
@@ -222,7 +222,7 @@ void NotesPaneModule::onMainViewSwitch(const OUString& rsViewURL, const bool bIs
}
}
bool NotesPaneModule::IsMasterView(const Reference<XView>& xView)
bool NotesPaneModule::IsMasterView(const rtl::Reference<AbstractView>& xView)
{
if (mpViewShellBase != nullptr)
{
@@ -250,7 +250,8 @@ void NotesPaneModule::onResourceRequest(
return;
// do not record the state of bottom pane when in master edit modes
if (!IsMasterView({ mxConfigurationController->getResource(aCenterViews[0]), UNO_QUERY }))
if (!IsMasterView(dynamic_cast<AbstractView*>(
mxConfigurationController->getResource(aCenterViews[0]).get())))
{
if (bActivation)
{
@@ -15,10 +15,6 @@
#include <tools/link.hxx>
#include <set>
namespace com::sun::star::drawing::framework
{
class XView;
}
namespace sd
{
class DrawController;
@@ -33,6 +29,7 @@ namespace sd::framework
{
class ConfigurationController;
class Configuration;
class AbstractView;
/** This module is responsible for handling visibility of NotesPane across modes
*/
@@ -77,7 +74,7 @@ private:
void onMainViewSwitch(const OUString& rsViewURL, const bool bIsActivated);
void onResourceRequest(bool bActivation,
const rtl::Reference<sd::framework::Configuration>& rxConfiguration);
bool IsMasterView(const css::uno::Reference<css::drawing::framework::XView>& xView);
bool IsMasterView(const rtl::Reference<sd::framework::AbstractView>& xView);
DECL_LINK(EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent&, void);
};
@@ -27,6 +27,7 @@
#include <framework/ConfigurationController.hxx>
#include <framework/ConfigurationChangeEvent.hxx>
#include <framework/FrameworkHelper.hxx>
#include <framework/AbstractView.hxx>
#include <vcl/EnumContext.hxx>
#include <com/sun/star/frame/XController.hpp>
@@ -354,14 +354,14 @@ bool FrameworkHelper::IsValid() const
return lcl_getViewShell( lcl_getFirstViewInPane( mxConfigurationController, xPaneId ) );
}
::std::shared_ptr<ViewShell> FrameworkHelper::GetViewShell (const Reference<XView>& rxView)
::std::shared_ptr<ViewShell> FrameworkHelper::GetViewShell (const rtl::Reference<AbstractView>& rxView)
{
return lcl_getViewShell( rxView );
}
Reference<XView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneOrViewId)
rtl::Reference<AbstractView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneOrViewId)
{
Reference<XView> xView;
rtl::Reference<AbstractView> xView;
if ( ! rxPaneOrViewId.is() || ! mxConfigurationController.is())
return nullptr;
@@ -370,11 +370,11 @@ Reference<XView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneO
{
if (rxPaneOrViewId->getResourceURL().match(msViewURLPrefix))
{
xView.set( mxConfigurationController->getResource( rxPaneOrViewId ), UNO_QUERY );
xView = dynamic_cast<AbstractView*>(mxConfigurationController->getResource( rxPaneOrViewId ).get());
}
else
{
xView.set( lcl_getFirstViewInPane( mxConfigurationController, rxPaneOrViewId ), UNO_QUERY );
xView = dynamic_cast<AbstractView*>(lcl_getFirstViewInPane( mxConfigurationController, rxPaneOrViewId ).get());
}
}
catch (lang::DisposedException&)
@@ -462,7 +462,7 @@ const OUString & FrameworkHelper::GetViewURL (ViewShell::ShellType eType)
namespace
{
void updateEditMode(const Reference<XView> &xView, const EditMode eEMode, bool updateFrameView)
void updateEditMode(const rtl::Reference<AbstractView> &xView, const EditMode eEMode, bool updateFrameView)
{
// Ensure we have the expected edit mode
// The check is only for DrawViewShell as OutlineViewShell
@@ -488,7 +488,7 @@ void asyncUpdateEditMode(FrameworkHelper* const pHelper, const EditMode eEMode)
{
Reference<XResourceId> xPaneId (
FrameworkHelper::CreateResourceId(framework::FrameworkHelper::msCenterPaneURL));
Reference<XView> xView (pHelper->GetView(xPaneId));
rtl::Reference<AbstractView> xView (pHelper->GetView(xPaneId));
updateEditMode(xView, eEMode, true);
}
@@ -527,7 +527,7 @@ void FrameworkHelper::HandleModeChangeSlot (
Reference<XResourceId> xPaneId (
CreateResourceId(framework::FrameworkHelper::msCenterPaneURL));
Reference<XView> xView (GetView(xPaneId));
rtl::Reference<AbstractView> xView (GetView(xPaneId));
// Compute requested view
OUString sRequestedView;
@@ -17,7 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
module com { module sun { module star { module drawing { module framework {
#pragma once
#include <com/sun/star/drawing/framework/XResource.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <comphelper/compbase.hxx>
#include <sddllapi.h>
namespace sd::framework
{
typedef comphelper::WeakComponentImplHelper<css::drawing::framework::XResource>
AbstractViewInterfaceBase;
/** A view in the drawing framework is any object that paints into a pane.
<p>Typical examples are the Impress views that show a graphical
@@ -28,11 +39,12 @@ module com { module sun { module star { module drawing { module framework {
reference them.</p>
<p>The URL prefix of views is <code>private:resource/view</code></p>
*/
interface XView
class SD_DLLPUBLIC AbstractView : public AbstractViewInterfaceBase
{
interface XResource;
public:
virtual ~AbstractView() override;
};
}; }; }; }; }; // ::com::sun::star::drawing::framework
} // end of namespace sd::framework
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -29,7 +29,6 @@
#include <mutex>
namespace com::sun::star::drawing::framework { class XResourceId; }
namespace com::sun::star::drawing::framework { class XView; }
namespace sd::framework { struct ConfigurationChangeEvent; }
namespace sd {
@@ -39,6 +38,7 @@ class ViewShellBase;
namespace sd::framework {
class ConfigurationController;
class AbstractView;
/** The FrameworkHelper is a convenience class that simplifies the
access to the drawing framework.
@@ -131,7 +131,7 @@ public:
reference then an empty pointer is returned.
*/
static ::std::shared_ptr<ViewShell> GetViewShell (
const css::uno::Reference<css::drawing::framework::XView>& rxView);
const rtl::Reference<sd::framework::AbstractView>& rxView);
typedef ::std::function<bool (const sd::framework::ConfigurationChangeEvent&)>
ConfigurationChangeEventFilter;
@@ -172,7 +172,7 @@ public:
of the involved objects does not support XTunnel (where
necessary).
*/
css::uno::Reference<css::drawing::framework::XView> GetView (
rtl::Reference<sd::framework::AbstractView> GetView (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneOrViewId);
/** Request the specified view to be displayed in the specified pane.
@@ -19,7 +19,7 @@
#pragma once
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <comphelper/compbase.hxx>
@@ -32,10 +32,11 @@ namespace com::sun::star::awt { class XWindow; }
namespace sd::framework {
typedef comphelper::WeakComponentImplHelper < css::awt::XWindowListener
, css::view::XSelectionSupplier
, css::drawing::framework::XView
> ViewShellWrapperInterfaceBase;
typedef cppu::ImplInheritanceHelper<
sd::framework::AbstractView
, css::awt::XWindowListener
, css::view::XSelectionSupplier
> ViewShellWrapperInterfaceBase;
/** This class wraps ViewShell objects and makes them look like an XView.
Most importantly it provides access to the ViewShell implementation.
+2 -2
View File
@@ -56,7 +56,7 @@
#include <xmloff/autolayout.hxx>
#include <comphelper/lok.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <string_view>
#include <vector>
@@ -476,7 +476,7 @@ void LayoutMenu::Fill()
{
Reference<XResourceId> xPaneId (new sd::framework::ResourceId(
FrameworkHelper::msCenterPaneURL));
Reference<XView> xView (FrameworkHelper::Instance(mrBase)->GetView(xPaneId));
rtl::Reference<framework::AbstractView> xView (FrameworkHelper::Instance(mrBase)->GetView(xPaneId));
if (xView.is())
sCenterPaneViewName = xView->getResourceId()->getResourceURL();
}
+5 -5
View File
@@ -33,7 +33,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <framework/ConfigurationChangeListener.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <comphelper/compbase.hxx>
#include <sfx2/viewfrm.hxx>
@@ -515,10 +515,10 @@ void EventMultiplexer::Implementation::notifyConfigurationChange (
// Add selection change listener at slide sorter.
if (rEvent.ResourceId->getResourceURL() == FrameworkHelper::msSlideSorterURL)
{
auto pView = dynamic_cast<sd::framework::AbstractView*>(rEvent.ResourceObject.get());
slidesorter::SlideSorterViewShell* pViewShell
= dynamic_cast<slidesorter::SlideSorterViewShell*>(
FrameworkHelper::GetViewShell(
Reference<XView>(rEvent.ResourceObject,UNO_QUERY)).get());
FrameworkHelper::GetViewShell(pView).get());
if (pViewShell != nullptr)
pViewShell->AddSelectionChangeListener (
LINK(this,
@@ -541,10 +541,10 @@ void EventMultiplexer::Implementation::notifyConfigurationChange (
// selection change listener at slide sorter.
if (rEvent.ResourceId->getResourceURL() == FrameworkHelper::msSlideSorterURL)
{
auto pView = dynamic_cast<framework::AbstractView*>(rEvent.ResourceObject.get());
slidesorter::SlideSorterViewShell* pViewShell
= dynamic_cast<slidesorter::SlideSorterViewShell*>(
FrameworkHelper::GetViewShell(
Reference<XView>(rEvent.ResourceObject, UNO_QUERY)).get());
FrameworkHelper::GetViewShell(pView).get());
if (pViewShell != nullptr)
pViewShell->RemoveSelectionChangeListener (
LINK(this,
+5 -6
View File
@@ -35,7 +35,7 @@
#include <sfx2/viewfrm.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/servicehelper.hxx>
@@ -258,13 +258,12 @@ bool ViewTabBar::ActivatePage(size_t nIndex)
mxController->getConfigurationController());
if ( ! xConfigurationController.is())
throw RuntimeException();
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
try
{
xView.set(xConfigurationController->getResource(
xView = dynamic_cast<framework::AbstractView*>(xConfigurationController->getResource(
new sd::framework::ResourceId(
FrameworkHelper::msCenterPaneURL)),
UNO_QUERY);
FrameworkHelper::msCenterPaneURL)).get());
}
catch (const DeploymentException&)
{
@@ -415,7 +414,7 @@ const std::vector<TabBarButton>& ViewTabBar::getTabBarButtons() const
void ViewTabBar::UpdateActiveButton()
{
Reference<XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
if (mpViewShellBase != nullptr)
xView = FrameworkHelper::Instance(*mpViewShellBase)->GetView(
mxViewTabBarId->getAnchor());
+2 -2
View File
@@ -20,7 +20,7 @@
#include <FrameView.hxx>
#include <svx/svxids.hrc>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <rtl/ustrbuf.hxx>
#include <unokywds.hxx>
#include <vcl/settings.hxx>
@@ -89,7 +89,7 @@ FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULL *
nSdViewShellCount++;
OUString sViewURL;
Reference<drawing::framework::XView> xView (
rtl::Reference<sd::framework::AbstractView> xView (
framework::FrameworkHelper::Instance(*pBase)->GetView(
new sd::framework::ResourceId(
framework::FrameworkHelper::msCenterPaneURL)));
+3 -3
View File
@@ -95,7 +95,7 @@
#include <AccessibleDocumentViewBase.hxx>
#include <framework/Configuration.hxx>
#include <com/sun/star/drawing/framework/XView.hpp>
#include <framework/AbstractView.hxx>
#include <com/sun/star/frame/XFrame.hpp>
using namespace ::com::sun::star;
@@ -428,10 +428,10 @@ void ViewShell::BroadcastContextForActivation(const bool bIsActivated)
{
auto pFrameworkHelper = framework::FrameworkHelper::Instance(GetViewShellBase());
uno::Reference<drawing::framework::XView> xView;
rtl::Reference<sd::framework::AbstractView> xView;
if (rResId->getResourceURL().match(framework::FrameworkHelper::msViewURLPrefix))
{
xView.set(xConfigurationController->getResource(rResId), UNO_QUERY);
xView = dynamic_cast<sd::framework::AbstractView*>(xConfigurationController->getResource(rResId).get());
if (xView.is())
{
+1 -1
View File
@@ -19,7 +19,7 @@
#pragma once
#include <com/sun/star/drawing/framework/XView.hpp>
#include <AbstractView.hxx>
#include <com/sun/star/ui/XToolPanel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/framework/XResourceId.hpp>