summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/slideshowimpl.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-16 09:31:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-16 12:18:44 +0200
commit6dbfba16d86b81419d833c6ab2c4904b67770069 (patch)
tree1fb4016fad44aacd95a55dd9753d5483aadec251 /slideshow/source/engine/slideshowimpl.cxx
parent51ccfd3b39d1d32052e8d51ab9ba7324ccd843f5 (diff)
slideshow: create instances with uno constructors
See tdf#74608 for motivation. Change-Id: I0b0a74ec8133de55664e471fcf13d7c66f882b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow/source/engine/slideshowimpl.cxx')
-rw-r--r--slideshow/source/engine/slideshowimpl.cxx41
1 files changed, 27 insertions, 14 deletions
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 9fd3d536dbce..cbc468d9f17b 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -23,9 +23,9 @@
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/scopeguard.hxx>
-#include <comphelper/servicedecl.hxx>
#include <comphelper/storagehelper.hxx>
#include <cppcanvas/polypolygon.hxx>
@@ -44,6 +44,7 @@
#include <com/sun/star/presentation/XSlideShowListener.hpp>
#include <com/sun/star/lang/NoSupportException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/drawing/PointSequence.hpp>
#include <com/sun/star/drawing/XLayer.hpp>
@@ -177,7 +178,7 @@ private:
******************************************************************************/
-typedef cppu::WeakComponentImplHelper<presentation::XSlideShow> SlideShowImplBase;
+typedef cppu::WeakComponentImplHelper<css::lang::XServiceInfo, presentation::XSlideShow> SlideShowImplBase;
typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
@@ -255,6 +256,11 @@ public:
virtual std::shared_ptr<avmedia::MediaTempFile> getMediaTempFile(const OUString& aUrl) override;
private:
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override;
+
// XSlideShow:
virtual sal_Bool SAL_CALL nextEffect() override;
virtual sal_Bool SAL_CALL previousEffect() override;
@@ -664,6 +670,21 @@ void SlideShowImpl::disposing()
mpPreviousSlide.reset();
}
+uno::Sequence< OUString > SAL_CALL SlideShowImpl::getSupportedServiceNames()
+{
+ return { "com.sun.star.presentation.SlideShow" };
+}
+
+OUString SAL_CALL SlideShowImpl::getImplementationName()
+{
+ return "com.sun.star.comp.presentation.SlideShow";
+}
+
+sal_Bool SAL_CALL SlideShowImpl::supportsService(const OUString& aServiceName)
+{
+ return cppu::supportsService(this, aServiceName);
+}
+
/// stops the current slide transition sound
void SlideShowImpl::stopSlideTransitionSound()
{
@@ -2387,18 +2408,10 @@ void FrameSynchronization::Deactivate()
} // anon namespace
-namespace sdecl = comphelper::service_decl;
-const sdecl::ServiceDecl slideShowDecl(
- sdecl::class_<SlideShowImpl>(),
- "com.sun.star.comp.presentation.SlideShow",
- "com.sun.star.presentation.SlideShow" );
-
-// The C shared lib entry points
-extern "C"
-SAL_DLLPUBLIC_EXPORT void* slideshow_component_getFactory( char const* pImplName,
- void*, void* )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+slideshow_SlideShowImpl_get_implementation(
+ css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
{
- return sdecl::component_getFactoryHelper( pImplName, {&slideShowDecl} );
+ return cppu::acquire(new SlideShowImpl(context));
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */