[Libreoffice-commits] core.git: drawinglayer/source svx/source

Armin Le Grand alg at apache.org
Sat Jun 15 08:40:00 PDT 2013


 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |    5 ++-
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx    |   19 +++++++++++++
 drawinglayer/source/processor2d/vclprocessor2d.cxx         |   18 ------------
 svx/source/sdr/contact/objectcontactofpageview.cxx         |    7 ----
 4 files changed, 25 insertions(+), 24 deletions(-)

New commits:
commit 16bb8dc8a0e1e797cac0f89d306b020b8534a8c4
Author: Armin Le Grand <alg at apache.org>
Date:   Mon May 6 14:13:44 2013 +0000

    Resolves: #i122216# Ensure FormControls get printed/PDFed
    
    also ensure graphics are all visible in metafiles
    
    (cherry picked from commit f3695b261c9fb6f7053b325bd25dc43f578b32fe)
    
    Change-Id: I70dcf53e56f883a8c28c85c410d3c9f0d1d4bbe1

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 378961fb..e7c43b8 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1356,7 +1356,10 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
                 {
-                    // direct draw of transformed BitmapEx primitive; use default processing
+                    // direct draw of transformed BitmapEx primitive; use default processing, but without
+                    // former testing if graphic content is inside discrete local viewport; this is not
+                    // setup for metafile targets (metafile renderer tries to render in logic coordinates,
+                    // the mapping is kept to the OutputDevice for better Metafile recording)
                     RenderBitmapPrimitive2D(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
                     break;
                 }
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index fdf3e68..fcbd44c 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -176,6 +176,25 @@ namespace drawinglayer
                 case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
                 {
                     // direct draw of transformed BitmapEx primitive
+                    const primitive2d::BitmapPrimitive2D& rBitmapCandidate = static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate);
+
+                    // check if graphic content is inside discrete local ViewPort
+                    const basegfx::B2DRange& rDiscreteViewPort(getViewInformation2D().getDiscreteViewport());
+                    const basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
+
+                    if(!rDiscreteViewPort.isEmpty())
+                    {
+                        basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+                        aUnitRange.transform(aLocalTransform);
+
+                        if(!aUnitRange.overlaps(rDiscreteViewPort))
+                        {
+                            // content is outside discrete local ViewPort
+                            break;
+                        }
+                    }
+
                     RenderBitmapPrimitive2D(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
                     break;
                 }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 56d56b7..e125f46 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -413,24 +413,8 @@ namespace drawinglayer
         // direct draw of transformed BitmapEx primitive
         void VclProcessor2D::RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate)
         {
-            // check local ViewPort
-            const basegfx::B2DRange& rDiscreteViewPort(getViewInformation2D().getDiscreteViewport());
-            const basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
-
-            if(!rDiscreteViewPort.isEmpty())
-            {
-                // check if we are visible
-                basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
-
-                aUnitRange.transform(aLocalTransform);
-
-                if(!aUnitRange.overlaps(rDiscreteViewPort))
-                {
-                    return;
-                }
-            }
-
             BitmapEx aBitmapEx(rBitmapCandidate.getBitmapEx());
+            const basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
 
             if(maBColorModifierStack.count())
             {
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 0e91865..d53539f 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -173,7 +173,6 @@ namespace sdr
             const double fCurrentTime(getPrimitiveAnimator().GetTime());
             OutputDevice& rTargetOutDev = GetPageWindow().GetPaintWindow().GetTargetOutputDevice();
             basegfx::B2DRange aViewRange;
-            basegfx::B2DHomMatrix aViewTransformation;
 
             // create ViewRange
             if(isOutputToRecordingMetaFile())
@@ -223,16 +222,12 @@ namespace sdr
 
                 // transform to world coordinates
                 aViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
-
-                // for metafile, leave ViewTransformation empty, but for pixel renderer
-                // get it from OutputDevice
-                aViewTransformation = rTargetOutDev.GetViewTransformation();
             }
 
             // update local ViewInformation2D
             const drawinglayer::geometry::ViewInformation2D aNewViewInformation2D(
                 basegfx::B2DHomMatrix(),
-                aViewTransformation,
+                rTargetOutDev.GetViewTransformation(),
                 aViewRange,
                 GetXDrawPageForSdrPage(GetSdrPage()),
                 fCurrentTime,


More information about the Libreoffice-commits mailing list