[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - slideshow/source

Michael Stahl mstahl at redhat.com
Mon Nov 13 15:36:46 UTC 2017


 slideshow/source/engine/shapes/drawshape.cxx |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 11e6f0d7e1b92ace72ab626ad293c43f4c7407ee
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Nov 10 23:28:19 2017 +0100

    slideshow: clip shapes in secondary screen window
    
    When using the presenter console, the secondary screen has
    a small view of the current slide.
    
    Currently nothing clips the shapes that are on the slide,
    so they may be rendered outside the slide rectangle,
    because there's a single VCL-canvas and OutPutDevice that covers
    the entire screen.
    
    Set up some brute force clipping in DrawShape::getViewRenderArgs().
    
    Change-Id: I3b21f08c12718254b6cf166b7fb1540e9381b243
    (cherry picked from commit 99e373cd4c78084ded349f3e3de7b0504af2dd90)
    Reviewed-on: https://gerrit.libreoffice.org/44613
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index 98f1cae40ac7..b1dc56b62741 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -134,11 +134,26 @@ namespace slideshow
 
         ViewShape::RenderArgs DrawShape::getViewRenderArgs() const
         {
+            uno::Reference<beans::XPropertySet> const xPropSet(mxPage,
+                    uno::UNO_QUERY_THROW);
+            sal_Int32 nWidth = 0;
+            sal_Int32 nHeight = 0;
+            xPropSet->getPropertyValue("Width") >>= nWidth;
+            xPropSet->getPropertyValue("Height") >>= nHeight;
+            basegfx::B2DRectangle slideRect(0, 0, nWidth, nHeight);
+            basegfx::B2DRectangle origBounds(maBounds);
+            origBounds.intersect(slideRect);
+            basegfx::B2DRectangle updateBounds(getUpdateArea());
+            updateBounds.intersect(slideRect);
+            basegfx::B2DRectangle bounds(getBounds());
+            bounds.intersect(slideRect);
+            basegfx::B2DRectangle unitBounds(getActualUnitShapeBounds());
+            unitBounds.intersect(slideRect);
             return ViewShape::RenderArgs(
-                maBounds,
-                getUpdateArea(),
-                getBounds(),
-                getActualUnitShapeBounds(),
+                origBounds,
+                updateBounds,
+                bounds,
+                unitBounds,
                 mpAttributeLayer,
                 maSubsetting.getActiveSubsets(),
                 mnPriority);


More information about the Libreoffice-commits mailing list