Kaydet (Commit) 54da5514 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Looks like no need to instantiate PresenterCanvas via service manager

(see commit message of 86ce77b9 "Don't adertise
PresenterCanvas as com.sun.star.rendering.Canvas service"; maybe it was just
cargo cult to make it available as a service in the first place)

Change-Id: I31291a7685c89d469309754cc4630b824a276890
üst e75979ea
......@@ -18,7 +18,6 @@
*/
#include "PresenterCanvas.hxx"
#include "facreg.hxx"
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
......@@ -27,10 +26,8 @@
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <canvas/canvastools.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ref.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
......@@ -109,19 +106,6 @@ private:
//===== PresenterCanvas =======================================================
PresenterCanvas::PresenterCanvas()
: PresenterCanvasInterfaceBase(m_aMutex),
mxUpdateCanvas(),
mxSharedCanvas(),
mxSharedWindow(),
mxWindow(),
maOffset(),
mpUpdateRequester(),
maClipRectangle(),
mbOffsetUpdatePending(true)
{
}
PresenterCanvas::PresenterCanvas (
const Reference<rendering::XSpriteCanvas>& rxUpdateCanvas,
const Reference<awt::XWindow>& rxUpdateWindow,
......@@ -157,82 +141,6 @@ void SAL_CALL PresenterCanvas::disposing()
mxWindow->removeWindowListener(this);
}
//----- XInitialization -------------------------------------------------------
void SAL_CALL PresenterCanvas::initialize (
const Sequence<Any>& rArguments)
throw(Exception, RuntimeException, std::exception)
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
ThrowIfDisposed();
if (rArguments.getLength() == 5)
{
try
{
// First and second argument may be NULL.
rArguments[0] >>= mxUpdateCanvas;
rArguments[1] >>= mxUpdateWindow;
if ( ! (rArguments[2] >>= mxSharedWindow))
{
throw lang::IllegalArgumentException("PresenterCanvas: invalid shared window",
static_cast<XWeak*>(this),
1);
}
if ( ! (rArguments[3] >>= mxSharedCanvas))
{
throw lang::IllegalArgumentException("PresenterCanvas: invalid shared canvas",
static_cast<XWeak*>(this),
2);
}
if ( ! (rArguments[4] >>= mxWindow))
{
throw lang::IllegalArgumentException("PresenterCanvas: invalid window",
static_cast<XWeak*>(this),
3);
}
mpUpdateRequester = CanvasUpdateRequester::Instance(mxUpdateCanvas);
mbOffsetUpdatePending = true;
if (mxWindow.is())
mxWindow->addWindowListener(this);
}
catch (RuntimeException&)
{
mxSharedWindow = nullptr;
mxWindow = nullptr;
throw;
}
}
else
{
throw RuntimeException("PresenterCanvas: invalid number of arguments",
static_cast<XWeak*>(this));
}
}
OUString PresenterCanvas::getImplementationName()
throw (css::uno::RuntimeException, std::exception)
{
return OUString("com.sun.star.comp.Draw.PresenterCanvasFactory");
}
sal_Bool PresenterCanvas::supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException, std::exception)
{
return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence<OUString> PresenterCanvas::getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception)
{
return css::uno::Sequence<OUString>{"com.sun.star.rendering.Canvas"};
}
//----- XCanvas ---------------------------------------------------------------
void SAL_CALL PresenterCanvas::clear()
......@@ -984,13 +892,4 @@ void PresenterCustomSprite::ThrowIfDisposed()
} } // end of namespace ::sd::presenter
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
com_sun_star_comp_Draw_PresenterCanvasFactory_get_implementation(css::uno::XComponentContext*,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new sd::presenter::PresenterCanvas());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -43,9 +43,7 @@ namespace {
typedef ::cppu::WeakComponentImplHelper <
css::rendering::XSpriteCanvas,
css::rendering::XBitmap,
css::awt::XWindowListener,
css::lang::XInitialization,
css::lang::XServiceInfo
css::awt::XWindowListener
> PresenterCanvasInterfaceBase;
}
......@@ -67,11 +65,6 @@ class PresenterCanvas
public PresenterCanvasInterfaceBase
{
public:
/** This constructor is used when a PresenterCanvas object is created as
a service.
*/
PresenterCanvas();
/** This constructor is used when a PresenterCanvas object is created
directly, typically by the PresenterCanvasFactory.
@param rxUpdateCanvas
......@@ -130,21 +123,6 @@ public:
const css::geometry::RealPoint2D& rLocation,
const css::geometry::RealSize2D& rSize);
// XInitialization
virtual void SAL_CALL initialize (
const css::uno::Sequence<css::uno::Any>& rArguments)
throw(css::uno::Exception, css::uno::RuntimeException, std::exception) override;
OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException, std::exception) override;
sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException, std::exception) override;
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception) override;
// XCanvas
virtual void SAL_CALL clear()
......
......@@ -31,9 +31,6 @@
<service name="com.sun.star.drawing.DrawingDocumentFactory"/>
<service name="com.sun.star.presentation.PresentationDocument"/>
</implementation>
<implementation name="com.sun.star.comp.Draw.PresenterCanvasFactory"
constructor="com_sun_star_comp_Draw_PresenterCanvasFactory_get_implementation">
</implementation>
<implementation name="com.sun.star.comp.Draw.PresenterHelper"
constructor="com_sun_star_comp_Draw_PresenterHelper_get_implementation">
<service name="com.sun.star.drawing.PresenterHelper"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment