offapi/UnoApi_offapi.mk | 2 offapi/com/sun/star/drawing/SlideRenderer.idl | 33 -------- offapi/com/sun/star/drawing/XSlideRenderer.idl | 94 ------------------------- sd/IwyuFilter_sd.yaml | 5 - sd/inc/SlideRenderer.hxx | 28 ++----- sd/source/console/PresenterSlidePreview.cxx | 4 - sd/source/console/PresenterSlidePreview.hxx | 1 sd/source/ui/presenter/SlideRenderer.cxx | 18 ---- 8 files changed, 13 insertions(+), 172 deletions(-)
New commits: commit 9b94c0cbbaa33c1241cdd57db9bc0cf1e9cf8229 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Jun 15 14:22:57 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jun 16 22:30:33 2025 +0200 Drop SlideRender service since the console code is now inside sd/, we dont need this anymore. Change-Id: Ic663c148a641297b1e935aa7f5e245643ebc1157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186569 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index e0fa38a4815e..07a8cacbff3f 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -141,7 +141,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/drawing,\ GraphicExportFilter \ ModuleDispatcher \ ShapeCollection \ - SlideRenderer \ SlideSorter \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/drawing/framework,\ @@ -2390,7 +2389,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/drawing,\ XShapes2 \ XShapes3 \ XSlidePreviewCacheListener \ - XSlideRenderer \ XSlideSorterBase \ XUniversalShapeDescriptor \ )) diff --git a/offapi/com/sun/star/drawing/SlideRenderer.idl b/offapi/com/sun/star/drawing/SlideRenderer.idl deleted file mode 100644 index f199e0d130da..000000000000 --- a/offapi/com/sun/star/drawing/SlideRenderer.idl +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -module com { module sun { module star { module drawing { - -/** Create preview bitmaps for single slides. -*/ -service SlideRenderer : XSlideRenderer -{ - /** Create a new SlideRenderer object. - */ - create (); -}; - -}; }; }; }; // ::com::sun::star::drawing - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/drawing/XSlideRenderer.idl b/offapi/com/sun/star/drawing/XSlideRenderer.idl deleted file mode 100644 index 8df410882426..000000000000 --- a/offapi/com/sun/star/drawing/XSlideRenderer.idl +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -module com { module sun { module star { module drawing { - -/** Create preview bitmaps for single slides. -*/ -interface XSlideRenderer -{ - /** Create a preview for the given slide that has the same aspect ratio - as the page and is as large as possible but not larger than the - specified size. - - The reason for not using the given size directly as preview size and - thus possibly changing the aspect ratio is that - a) a different aspect ratio is not used often, and - b) leaving the adaptation of the actual preview size (according to the - aspect ratio of the slide) to the slide renderer is more convenient - to the caller than having to this himself. - - @param xSlide - The slide for which a preview will be created. - @param aMaximumPreviewPixelSize - The maximum size of the preview measured in pixels. When the - aspect ratios of this size and of the given slide differ, then - resulting preview will either have the width or the height of - this size. - @param nSuperSampleFactor - When larger than the default 1 then internally a larger preview - is created which, before it is returned, is scaled down to the - requested size. The intermediate size is nSuperSampleFactor - times the original size. Values larger than 1 result in higher - memory consumption and longer runtime. - This value is an attempt to provide some antialiasing and so to - provide more readable slide previews. May become obsolete in - the future when true antialiasing support will be integrated. - */ - com::sun::star::awt::XBitmap createPreview ( - [in] XDrawPage xSlide, - [in] com::sun::star::awt::Size aMaximumPreviewPixelSize, - [in] short nSuperSampleFactor); - - /** Exactly the same functionality as createPreview(), - only a different return type: - com::sun::star::rendering::XBitmap instead - of com::sun::star::awt::XBitmap. - @see createPreview - @param xSlide - See description in #createPreview. - @param aMaximumPreviewPixelSize - See description in #createPreview. - @param nSuperSampleFactor - See description in #createPreview. - @param xCanvas - This canvas is used create a canvas specific bitmap. - */ - com::sun::star::rendering::XBitmap createPreviewForCanvas ( - [in] XDrawPage xSlide, - [in] com::sun::star::awt::Size aMaximumPreviewPixelSize, - [in] short nSuperSampleFactor, - [in] com::sun::star::rendering::XCanvas xCanvas); - - /** Return a size that has the given aspect ratio and shares either the - width or the height with the given maximum size. - @param nSlideAspectRatio - The aspect ratio must not be 0. - @param aMaximumPreviewPixelSize - The maximum size of the returned preview size. - */ - com::sun::star::awt::Size calculatePreviewSize ( - [in] double nSlideAspectRatio, - [in] com::sun::star::awt::Size aMaximumPreviewPixelSize); -}; - -}; }; }; }; // ::com::sun::star::drawing - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml index ea48da25860f..c9254926878e 100644 --- a/sd/IwyuFilter_sd.yaml +++ b/sd/IwyuFilter_sd.yaml @@ -273,11 +273,6 @@ excludelist: - com/sun/star/rendering/XSpriteCanvas.hpp - com/sun/star/rendering/XBitmap.hpp - com/sun/star/awt/XWindowListener.hpp - sd/inc/SlideRenderer.hxx: - # base class has to be a complete type - - com/sun/star/drawing/XSlideRenderer.hpp - - com/sun/star/lang/XInitialization.hpp - - com/sun/star/lang/XServiceInfo.hpp sd/source/ui/remotecontrol/Listener.hxx: # base class has to be a complete type - com/sun/star/presentation/XSlideShowListener.hpp diff --git a/sd/inc/SlideRenderer.hxx b/sd/inc/SlideRenderer.hxx index 34afc67696e2..41f9f43cebd3 100644 --- a/sd/inc/SlideRenderer.hxx +++ b/sd/inc/SlideRenderer.hxx @@ -21,19 +21,15 @@ #include "sddllapi.h" #include <PreviewRenderer.hxx> -#include <com/sun/star/drawing/XSlideRenderer.hpp> -#include <com/sun/star/lang/XInitialization.hpp> - #include <comphelper/compbase.hxx> +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/rendering/XBitmap.hpp> namespace com::sun::star::drawing { class XDrawPage; } namespace sd::presenter { -typedef comphelper::WeakComponentImplHelper < - css::drawing::XSlideRenderer, - css::lang::XInitialization -> SlideRendererInterfaceBase; +typedef comphelper::WeakComponentImplHelper<> SlideRendererInterfaceBase; /** Render single slides into bitmaps. */ @@ -46,26 +42,20 @@ public: SlideRenderer(const SlideRenderer&) = delete; SlideRenderer& operator=(const SlideRenderer&) = delete; - // XInitialization - - virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override; - - // XSlideRenderer - - virtual css::uno::Reference<css::awt::XBitmap> SAL_CALL createPreview ( + css::uno::Reference<css::awt::XBitmap> createPreview ( const css::uno::Reference<css::drawing::XDrawPage>& rxSlide, const css::awt::Size& rMaximumPreviewPixelSize, - sal_Int16 nSuperSampleFactor) override; + sal_Int16 nSuperSampleFactor); - virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL createPreviewForCanvas ( + css::uno::Reference<css::rendering::XBitmap> createPreviewForCanvas ( const css::uno::Reference<css::drawing::XDrawPage>& rxSlide, const css::awt::Size& rMaximumPreviewPixelSize, sal_Int16 nSuperSampleFactor, - const css::uno::Reference<css::rendering::XCanvas>& rxCanvas) override; + const css::uno::Reference<css::rendering::XCanvas>& rxCanvas); - virtual css::awt::Size SAL_CALL calculatePreviewSize ( + static css::awt::Size calculatePreviewSize ( double nSlideAspectRatio, - const css::awt::Size& rMaximumPreviewPixelSize) override; + const css::awt::Size& rMaximumPreviewPixelSize); private: PreviewRenderer maPreviewRenderer; diff --git a/sd/source/console/PresenterSlidePreview.cxx b/sd/source/console/PresenterSlidePreview.cxx index a31990fea1bb..4f8973135f04 100644 --- a/sd/source/console/PresenterSlidePreview.cxx +++ b/sd/source/console/PresenterSlidePreview.cxx @@ -237,7 +237,7 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox) { if (mnSlideAspectRatio > 0) { - const awt::Size aPreviewSize (mxPreviewRenderer->calculatePreviewSize( + const awt::Size aPreviewSize (sd::presenter::SlideRenderer::calculatePreviewSize( mnSlideAspectRatio,awt::Size(aWindowBox.Width, aWindowBox.Height))); aPreviewBox = awt::Rectangle( (aWindowBox.Width - aPreviewSize.Width)/2, @@ -316,7 +316,7 @@ void PresenterSlidePreview::Resize() if (mxPreviewRenderer.is() && mxPreview.is()) { const awt::Rectangle aWindowBox (mxWindow->getPosSize()); - const awt::Size aNewPreviewSize (mxPreviewRenderer->calculatePreviewSize( + const awt::Size aNewPreviewSize (sd::presenter::SlideRenderer::calculatePreviewSize( mnSlideAspectRatio, awt::Size(aWindowBox.Width, aWindowBox.Height))); const geometry::IntegerSize2D aPreviewSize (mxPreview->getSize()); diff --git a/sd/source/console/PresenterSlidePreview.hxx b/sd/source/console/PresenterSlidePreview.hxx index 78bd6565c0c3..959d9faa285e 100644 --- a/sd/source/console/PresenterSlidePreview.hxx +++ b/sd/source/console/PresenterSlidePreview.hxx @@ -27,7 +27,6 @@ #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/XSlideRenderer.hpp> #include <com/sun/star/drawing/framework/XPane.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/uno/XComponentContext.hpp> diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx index 43d85d880dad..bf817dd63f9a 100644 --- a/sd/source/ui/presenter/SlideRenderer.cxx +++ b/sd/source/ui/presenter/SlideRenderer.cxx @@ -39,21 +39,6 @@ SlideRenderer::~SlideRenderer() { } -//----- XInitialization ------------------------------------------------------- - -void SAL_CALL SlideRenderer::initialize (const Sequence<Any>& rArguments) -{ - ThrowIfDisposed(); - - if (rArguments.hasElements()) - { - throw RuntimeException(u"SlideRenderer: invalid number of arguments"_ustr, - static_cast<XWeak*>(this)); - } -} - -//----- XSlideRenderer -------------------------------------------------------- - Reference<awt::XBitmap> SlideRenderer::createPreview ( const Reference<drawing::XDrawPage>& rxSlide, const awt::Size& rMaximalSize, @@ -85,7 +70,8 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas ( return nullptr; } -awt::Size SAL_CALL SlideRenderer::calculatePreviewSize ( +// static +awt::Size SlideRenderer::calculatePreviewSize ( double nSlideAspectRatio, const awt::Size& rMaximalSize) {