From 62c2022ba73b165072e0bf01f7f368f0ecda9aad Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 22 Jan 2014 20:25:16 +0000 Subject: Resolves: #i123983# Corrected Graphic Metafile fallback creator (cherry picked from commit b5797deea72476fbcec4315f1f18249fd39bbaea) Change-Id: I4d09592cd9e4b86445d048fb875e7bc13b03801d --- vcl/source/gdi/impgraph.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'vcl/source/gdi/impgraph.cxx') diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 4b87d6fc3db2..5fe15726bdd8 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -630,22 +630,21 @@ const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const pThat->maEx = maSvgData->getReplacement(); } - VirtualDevice aVirDev; - const Size aSizePixel(maEx.GetSizePixel()); - - pThat->maMetaFile.Record(&aVirDev); - + // #123983# directly create a metafile with the same PrefSize and PrefMapMode + // the bitmap has, this will be an always correct metafile if(maEx.IsTransparent()) { - aVirDev.DrawBitmapEx(Point(), maEx); + pThat->maMetaFile.AddAction(new MetaBmpExScaleAction(Point(), maEx.GetPrefSize(), maEx)); } else { - aVirDev.DrawBitmap(Point(), maEx.GetBitmap()); + pThat->maMetaFile.AddAction(new MetaBmpScaleAction(Point(), maEx.GetPrefSize(), maEx.GetBitmap())); } pThat->maMetaFile.Stop(); - pThat->maMetaFile.SetPrefSize(aSizePixel); + pThat->maMetaFile.WindStart(); + pThat->maMetaFile.SetPrefSize(maEx.GetPrefSize()); + pThat->maMetaFile.SetPrefMapMode(maEx.GetPrefMapMode()); } return maMetaFile; -- cgit