summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/shapes
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 /slideshow/source/engine/shapes
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 'slideshow/source/engine/shapes')
-rw-r--r--slideshow/source/engine/shapes/shapeimporter.cxx30
1 files changed, 25 insertions, 5 deletions
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index 42eed1dc9952..bca8cc3f06ca 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -201,6 +201,15 @@ ShapeSharedPtr ShapeImporter::createShape(
uno::Reference<beans::XPropertySet> const& xPropSet,
std::u16string_view shapeType ) const
{
+ css::uno::Reference<css::drawing::XDrawPage> xPage = mxPage;
+ if (mbConvertingMasterPage && mbMasterPageObjectsOnly)
+ {
+ const XShapesEntry& rTop = maShapesStack.top();
+ css::uno::Reference<css::drawing::XDrawPage> xMasterPage(rTop.mxShapes, uno::UNO_QUERY_THROW);
+ if (xMasterPage.is())
+ xPage = xMasterPage;
+ }
+
if( shapeType == u"com.sun.star.drawing.MediaShape" || shapeType == u"com.sun.star.presentation.MediaShape" )
{
// Media shape (video etc.). This is a special object
@@ -233,7 +242,7 @@ ShapeSharedPtr ShapeImporter::createShape(
// #i46224# Mark OLE shapes as foreign content - scan them for
// unsupported actions, and fallback to bitmap, if necessary
return DrawShape::create( xCurrShape,
- mxPage,
+ xPage,
mnAscendingPrio,
true,
mrContext );
@@ -258,7 +267,7 @@ ShapeSharedPtr ShapeImporter::createShape(
// anyway, or it's a metafile, which currently the
// metafile renderer might not display correctly.
return DrawShape::create( xCurrShape,
- mxPage,
+ xPage,
mnAscendingPrio,
true,
mrContext );
@@ -318,7 +327,7 @@ ShapeSharedPtr ShapeImporter::createShape(
aGraphAttrs ) );
return DrawShape::create( xCurrShape,
- mxPage,
+ xPage,
mnAscendingPrio,
std::move(pGraphic),
mrContext );
@@ -326,7 +335,7 @@ ShapeSharedPtr ShapeImporter::createShape(
else
{
return DrawShape::create( xCurrShape,
- mxPage,
+ xPage,
mnAscendingPrio,
false,
mrContext );
@@ -392,6 +401,15 @@ bool ShapeImporter::isSkip(
{
return true;
}
+ if( mbTextFieldsOnly )
+ {
+ if( !( shapeType == u"com.sun.star.presentation.SlideNumberShape" ||
+ shapeType == u"com.sun.star.presentation.FooterShape" ||
+ shapeType == u"com.sun.star.presentation.DateTimeShape" ) )
+ {
+ return true;
+ }
+ }
}
return false;
}
@@ -543,7 +561,9 @@ ShapeImporter::ShapeImporter( uno::Reference<drawing::XDrawPage> const&
maPolygons(),
maShapesStack(),
mnAscendingPrio( nOrdNumStart ),
- mbConvertingMasterPage( bConvertingMasterPage )
+ mbConvertingMasterPage( bConvertingMasterPage ),
+ mbMasterPageObjectsOnly( false ),
+ mbTextFieldsOnly( false )
{
uno::Reference<drawing::XShapes> const xShapes(
xPage, uno::UNO_QUERY_THROW );