summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/drviewsk.cxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2024-06-24 15:26:18 +0900
committerMiklos Vajna <vmiklos@collabora.com>2024-07-10 08:05:56 +0200
commit1f0fd06bc0cfe5036661ce2c23911f34eccf678a (patch)
treee18e8ec47b4b788c9cf3e5eb62021e5df6d6c3ed /sd/source/ui/view/drviewsk.cxx
parent6f96e7720f765d4e5e8fdef6a2a2b8cbb75c81ef (diff)
sd: slideshow render interface and implementation
Interface and implementation to expose the ability to render the slide's layers to a bitmap. Change-Id: I3da48585e498354592e163d84bd29659b233c255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170214 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd/source/ui/view/drviewsk.cxx')
-rw-r--r--sd/source/ui/view/drviewsk.cxx42
1 files changed, 42 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviewsk.cxx b/sd/source/ui/view/drviewsk.cxx
index bdbb821e96b3..cb40d8398f04 100644
--- a/sd/source/ui/view/drviewsk.cxx
+++ b/sd/source/ui/view/drviewsk.cxx
@@ -11,12 +11,18 @@
#include <ViewShellBase.hxx>
#include <sdmod.hxx>
+#include <com/sun/star/presentation/SlideShow.hpp>
+
#include <comphelper/lok.hxx>
+#include <comphelper/diagnose_ex.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
#include <sfx2/lokhelper.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <unomodel.hxx>
+using namespace css;
+
namespace sd {
void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, ConfigurationHints )
@@ -57,6 +63,42 @@ void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorCon
maViewOptions.mnAppBackgroundColor = aFillColor;
}
+void DrawViewShell::destroyXSlideShowInstance()
+{
+ if (!mxSlideShow.is())
+ return;
+
+ try
+ {
+ uno::Reference<lang::XComponent> xComponent(mxSlideShow, uno::UNO_QUERY);
+ if (xComponent.is())
+ xComponent->dispose();
+ }
+ catch (uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION( "sd", "DrawViewShell::destroyXSlideShowInstance dispose");
+ }
+
+ mxSlideShow.clear();
+}
+
+uno::Reference<presentation::XSlideShow> DrawViewShell::getXSlideShowInstance()
+{
+ if (!mxSlideShow.is())
+ {
+ try
+ {
+ auto xContext = ::comphelper::getProcessComponentContext();
+ mxSlideShow.set(presentation::SlideShow::create(xContext), uno::UNO_SET_THROW);
+ }
+ catch (uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("sd", "DrawViewShell::createXSlideShowInstance()");
+ }
+ }
+ return mxSlideShow;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */