summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Jaap <patrick.jaap@tu-dresden.de>2017-10-13 11:31:28 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-03-13 16:49:30 +0100
commit508fc36db06172388b205053f41a3a1d3326920b (patch)
treef74d1184b168f13d733c334454b1f3881b214667
parentff2223ca4f0cf201e4b0067a5b66340dbfca5929 (diff)
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
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx11
1 files changed, 10 insertions, 1 deletions
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() );