[Libreoffice-commits] core.git: Branch 'distro/vector/vector-5.4' - cppcanvas/source

Patrick Jaap (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 13 15:50:12 UTC 2020


 cppcanvas/source/mtfrenderer/emfplus.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 508fc36db06172388b205053f41a3a1d3326920b
Author:     Patrick Jaap <patrick.jaap at tu-dresden.de>
AuthorDate: Fri Oct 13 11:31:28 2017 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Mar 13 16:49:30 2020 +0100

    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

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() );


More information about the Libreoffice-commits mailing list