incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 119735] SVG Export: missing implementation for com.sun.star.svg.SVGWriter when using GraphicProvider
Date Fri, 08 Jun 2012 15:17:19 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=119735

--- Comment #4 from Armin Le Grand <Armin.Le.Grand@me.com> ---
ALG: Thanks Ariel, this makes it testable.
I used a bitmap graphic, inserted, selected and exported to SVG. The exported
SVG is just some bytes. This is because GraphicFilter::ExportGraphic for the
EXP_SVG case does not check if the Graphic is a Metafile, but just uses it by
calling aGraphic.GetGDIMetaFile(). The Metafile contains a bitmap, thus an
empty Metafile is used and the export is empty.
Interestingly GetGDIMetaFile just returns the local Metafile of the Graphic
without any checks; compared to that the calls GetBitmap/GetBitmapEx at Graphic
both convert the content to a Bitmap/BitmapEx when the content actually is a
Metafile. I also found a lot of places where the type is checked before calling
GetGDIMetaFile and a small, local conversion is done (VDev, Metafile with one
Bitmap paint action is created).
For conformity it would make sense to do the conversion inside
ImpGraphic::ImplGetGDIMetaFile and to remove as many places as possible where
this is done locally (e.g. interstingly in GraphicFilter::ExportGraphic). Only
caveat is that ImpGraphic::ImplGetGDIMetaFile returns a 'const GDIMetaFile&',
thus creating a local one and returning would require to change the return
type. In comparison, ImplGetBitmap/ImplGetBitmapEx return by value.
Bitmap/BitmapEx is not expensive returning by value since these are refcounted
internally, but Metafile is not and thus expensive.
There is a Metafile member in ImpGraphic, and it is empty when type is
GRAPHIC_BITMAP, so using it as local buffer is a possibility. I checked usages
of maMetaFile and it never gets used when type is GRAPHIC_BITMAP. It gets
copied in operator=, so buffering would survive buffering. It would get lost in
save/load, but that's okay. All in all it seems possible.
I will try it out...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message