Blame SOURCES/0001-Related-tdf-105998-except-cut-and-paste-as-bitmap-in.patch

55db36
From 15cdcd0346b7aa98d4697edec8aeea9c810efa62 Mon Sep 17 00:00:00 2001
55db36
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
55db36
Date: Tue, 5 Dec 2017 17:13:28 +0000
55db36
Subject: [PATCH] Related: tdf#105998 except cut and paste as bitmap instead of
55db36
 export
55db36
MIME-Version: 1.0
55db36
Content-Type: text/plain; charset=UTF-8
55db36
Content-Transfer-Encoding: 8bit
55db36
55db36
Take a drawing rectangle in draw and cut and paste as bitmap to writer.  The
55db36
hairline border along the very right/bottom edge of the bitmap appear missing.
55db36
55db36
fallback to default handlers which can distort the hairline to be visible
55db36
55db36
Change-Id: Iedb580f65879628839c83e41092745ae7c11267c
55db36
Reviewed-on: https://gerrit.libreoffice.org/45902
55db36
Tested-by: Jenkins <ci@libreoffice.org>
55db36
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
55db36
Tested-by: Caolán McNamara <caolanm@redhat.com>
55db36
---
55db36
 .../source/processor2d/vclpixelprocessor2d.cxx     | 25 +++++++++++++++++-----
55db36
 1 file changed, 20 insertions(+), 5 deletions(-)
55db36
55db36
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
55db36
index 9c21c83ee..5c5c0bb 100644
55db36
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
55db36
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
55db36
@@ -41,6 +41,7 @@
55db36
 #include "helperwrongspellrenderer.hxx"
55db36
 #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
55db36
 #include <basegfx/polygon/b2dpolygontools.hxx>
55db36
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
55db36
 #include <vcl/hatch.hxx>
55db36
 #include <tools/diagnose_ex.h>
55db36
 #include <com/sun/star/awt/PosSize.hpp>
55db36
@@ -210,10 +211,6 @@ namespace drawinglayer
55db36
                 maBColorModifierStack.getModifiedColor(
55db36
                     rSource.getLineAttribute().getColor()));
55db36
 
55db36
-            mpOutputDevice->SetFillColor();
55db36
-            mpOutputDevice->SetLineColor(Color(aLineColor));
55db36
-            aHairLinePolyPolygon.transform(maCurrentTransformation);
55db36
-
55db36
             double fLineWidth(rSource.getLineAttribute().getWidth());
55db36
 
55db36
             if(basegfx::fTools::more(fLineWidth, 0.0))
55db36
@@ -234,6 +231,24 @@ namespace drawinglayer
55db36
                 fLineWidth = 0.0;
55db36
             }
55db36
 
55db36
+            //Related: tdf#105998 cut and paste as bitmap of shape from draw to
55db36
+            //writer.  If we are a hairline along the very right/bottom edge of
55db36
+            //the canvas then fallback to defaults which can distort the
55db36
+            //hairline inside the paintable area
55db36
+            if (fLineWidth == 0.0)
55db36
+            {
55db36
+                Size aSize = mpOutputDevice->GetOutputSize();
55db36
+                basegfx::B2DRange aRange = aHairLinePolyPolygon.getB2DRange();
55db36
+                basegfx::B2DRange aOutputRange = aRange;
55db36
+                aOutputRange.transform(maCurrentTransformation);
55db36
+                if (std::round(aOutputRange.getMaxX()) == aSize.Width() || std::round(aOutputRange.getMaxY()) == aSize.Height())
55db36
+                    return false;
55db36
+            }
55db36
+
55db36
+            mpOutputDevice->SetFillColor();
55db36
+            mpOutputDevice->SetLineColor(Color(aLineColor));
55db36
+            aHairLinePolyPolygon.transform(maCurrentTransformation);
55db36
+
55db36
             bool bHasPoints(false);
55db36
             bool bTryWorked(false);
55db36
 
55db36
-- 
55db36
2.9.5
55db36