diff options
author | Armin Le Grand <alg@apache.org> | 2012-06-11 08:38:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-14 21:33:59 +0100 |
commit | 4fa8df7320f6bdc8333f5936537d2ed93e8892ce (patch) | |
tree | 3b3d06d3ba0dd698e1fb168171e4de1b4d60c12a /vcl/source/gdi/impgraph.cxx | |
parent | 9bc0ca091b7037f7c8f4782103a81b7287bc1de3 (diff) |
Resolves: #i119735# missing css.svg.SVGWriter when using GraphicProvider
missing implementation for com.sun.star.svg.SVGWriter when using
GraphicProvider
Adapted patch provided by Sven Jacobi (thanks), added some fixes/cleanups to
make it work with all kind of graphics (SVG, Bitmap, Metafile)
(cherry picked from commit 891011181285d7ad54984ffd05ed44d825a70647)
Conflicts:
filter/inc/filter/msfilter/msdffimp.hxx
filter/source/graphicfilter/epict/epict.cxx
filter/source/svg/svgexport.cxx
filter/source/svg/svguno.cxx
filter/source/svg/svgwriter.cxx
filter/source/svg/svgwriter.hxx
svtools/source/filter/filter.cxx
Change-Id: Ie53f995614060a00c709f620f89d132913a25c5c
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index d980fc5f09c4..be5663754b6a 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -595,6 +595,40 @@ Animation ImpGraphic::ImplGetAnimation() const const GDIMetaFile& ImpGraphic::ImplGetGDIMetaFile() const { + if (GRAPHIC_BITMAP == meType && !maMetaFile.GetActionSize()) + { + // #i119735# + // Use the local maMetaFile as container for a metafile-representation + // of the bitmap graphic. This will be done only once, thus be buffered. + // I checked all usages of maMetaFile, it is only used when type is not + // GRAPHIC_BITMAP. In operator= it will get copied, thus buffering will + // survive copying (change this if not wanted) + ImpGraphic* pThat = const_cast< ImpGraphic* >(this); + + if(maSvgData.get() && !maEx) + { + // use maEx as local buffer for rendered svg + pThat->maEx = maSvgData->getReplacement(); + } + + VirtualDevice aVirDev; + const Size aSizePixel(maEx.GetSizePixel()); + + pThat->maMetaFile.Record(&aVirDev); + + if(maEx.IsTransparent()) + { + aVirDev.DrawBitmapEx(Point(), maEx); + } + else + { + aVirDev.DrawBitmap(Point(), maEx.GetBitmap()); + } + + pThat->maMetaFile.Stop(); + pThat->maMetaFile.SetPrefSize(aSizePixel); + } + return maMetaFile; } |