kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0036-EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch

f0633d
From 6bd555fd034582352dca98266f600340ade1895e Mon Sep 17 00:00:00 2001
f0633d
From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= <matus.kukan@collabora.com>
f0633d
Date: Wed, 4 Dec 2013 16:57:34 +0100
f0633d
Subject: [PATCH 036/109] EMF+: Do not ignore source rectangle of the image to
f0633d
 be rendered.
f0633d
MIME-Version: 1.0
f0633d
Content-Type: text/plain; charset=UTF-8
f0633d
Content-Transfer-Encoding: 8bit
f0633d
f0633d
Change-Id: I4f861c7653c89d8f1ca73696e885f33f7bfc3b06
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6932
f0633d
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
f0633d
Tested-by: Caolán McNamara <caolanm@redhat.com>
f0633d
---
f0633d
 cppcanvas/source/mtfrenderer/emfplus.cxx | 2 ++
f0633d
 1 file changed, 2 insertions(+)
f0633d
f0633d
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
f0633d
index bf9720b..2387934 100644
f0633d
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
f0633d
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
f0633d
@@ -1862,6 +1862,7 @@ namespace cppcanvas
f0633d
                                 sal_Int32 aCount;
f0633d
 
f0633d
                                 ReadRectangle (rMF, sx, sy, sw, sh);
f0633d
+                                Rectangle aSource(Point(sx, sy), Size(sw, sh));
f0633d
 
f0633d
                                 SAL_INFO("cppcanvas.emf", "EMF+ " << (type == EmfPlusRecordTypeDrawImagePoints ? "DrawImagePoints" : "DrawImage") << " source rectangle: " << sx << "," << sy << " " << sw << "x" << sh);
f0633d
 
f0633d
@@ -1902,6 +1903,7 @@ namespace cppcanvas
f0633d
 
f0633d
                                 if (bValid) {
f0633d
                                     BitmapEx aBmp( image.graphic.GetBitmapEx () );
f0633d
+                                    aBmp.Crop( aSource );
f0633d
 
f0633d
                                     Size aSize( aBmp.GetSizePixel() );
f0633d
                                     SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height());
f0633d
-- 
f0633d
1.8.4.2
f0633d