From cdfa19a797da82aa238ba21cef92682d9a069a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Tue, 23 Jul 2024 12:16:16 +0200 Subject: [PATCH] lok: render the whole slide temporary (with bg and master content) This changes the rendering of the main slide layer content to also render the master page and the background. This is needed because of the issue with the white background (instead of transaprent). (cherry picked from commit 99f9d663a26da00bebd8595f1e0819ebc6c3e4f0) Change-Id: I88b6f0287482ad1ee498b0bbda8e19d015649879 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173853 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- slideshow/source/engine/slide/slideimpl.cxx | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 6bb05bb874f6..ff796e011bda 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -620,6 +620,36 @@ void LOKSlideRenderer::renderDrawPageImpl(VirtualDevice& rDevice) aJsonWriter.put("index", mnDPLayerIndex); bool bDoRendering = false; + + std::shared_ptr pMasterShapeImporter = std::make_shared(mxMasterPage, mxDrawPage, mxDrawPagesSupplier, mrContext, 0, true); + + ShapeSharedPtr const& rBGShape(pMasterShapeImporter->importBackgroundShape()); + if (rBGShape) + { + bDoRendering = true; + mpLayerManager->addShape(rBGShape); + } + + while (!pMasterShapeImporter->isImportDone()) + { + ShapeSharedPtr const& rShape(pMasterShapeImporter->importShape()); + if (!rShape) + continue; + + rShape->setIsForeground(false); + + uno::Reference xShape = rShape->getXShape(); + if (xShape.is()) + { + + mpLayerManager->addShape(rShape); + bDoRendering = true; + } + } + + auto nCurrCount = static_cast(pMasterShapeImporter->getImportedShapesCount()); + mpShapesFunctor = std::make_shared(mxDrawPage, mxDrawPage, mxDrawPagesSupplier, mrContext, nCurrCount, false); + while (!mpShapesFunctor->isImportDone()) { ShapeSharedPtr const& rShape(mpShapesFunctor->importShape());