From 508fc36db06172388b205053f41a3a1d3326920b Mon Sep 17 00:00:00 2001 From: Patrick Jaap Date: Fri, 13 Oct 2017 11:31:28 +0200 Subject: tdf#31814 Fix for EMF+ DrawString and DrawImage DrawString: The value 'fontAttribute' is optional and may be null, results in missing characters. DrawImage: The case of 'metafile' was missing and leads to low resolution rendering. (cherry picked from commit 52a2a0101f71b21876f17d5419132ffa27f6e35d) Conflicts: drawinglayer/source/tools/emfphelperdata.cxx Change-Id: I81566d884975fda832f4a5af6663c837f355c383 --- cppcanvas/source/mtfrenderer/emfplus.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 00ca97a2d10c..710376b5d9e4 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -1236,7 +1236,16 @@ namespace cppcanvas } if (bValid) { - BitmapEx aBmp( image.graphic.GetBitmapEx () ); + BitmapEx aBmp; + if (image.type == 1) // Bitmap + { + aBmp = image.graphic.GetBitmapEx(); + } + else if (image.type == 2) // Metafile + { + GraphicConversionParameters aParameters(Size(aDstSize.getX(), aDstSize.getY())); + aBmp = image.graphic.GetBitmapEx(aParameters); + } aBmp.Crop( aSource ); Size aSize( aBmp.GetSizePixel() ); -- cgit v1.2.3