summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/impgraph.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-01-22 20:25:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-23 11:30:17 +0000
commit62c2022ba73b165072e0bf01f7f368f0ecda9aad (patch)
treeba1bd7599e0f4d31c0b68647d56d97880bcff25e /vcl/source/gdi/impgraph.cxx
parent235723e5eb2983361ec81d6898947cc8bccab224 (diff)
Resolves: #i123983# Corrected Graphic Metafile fallback creator
(cherry picked from commit b5797deea72476fbcec4315f1f18249fd39bbaea) Change-Id: I4d09592cd9e4b86445d048fb875e7bc13b03801d
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r--vcl/source/gdi/impgraph.cxx15
1 files changed, 7 insertions, 8 deletions
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;