Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Not all exporters support ClipRegions in Metafiles | ||
---|---|---|---|
Product: | Draw | Reporter: | Armin Le Grand <Armin.Le.Grand> |
Component: | save-export | Assignee: | Armin Le Grand <Armin.Le.Grand> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | Normal | ||
Priority: | P3 | CC: | phoenix.wanglf, rb.henschel |
Version: | 4.0.0-dev | ||
Target Milestone: | 4.0.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
Armin Le Grand
2012-10-24 12:01:58 UTC
ALG: Taking over ALG: Thought abou this. There are generally three solutions: (a) Change the exports to be based on primitives (rewrite) (b) Extend old exports to take clip region actions int account (c) Clip metafile independent of export as export preparation Possibility (a) will take too long and will be the long-term solution. Possibility (b) is poyyible, but hard to do in old code, also unclear how far e.g. WMF supports ClipRegions based on polygons, will be more like RegionBands. Decided to do (c) and add a tooling method for clipping the content of a metafile against it's contained clip regions. This can then be used to prepare the metafile for these old exporters. ALG: Progressing with (c), adapted to wmf and emf to check, works as expected. Extending implementation... ALG: Added all kinds of geometry primitives, works well. Checked the bug with the same method as in comment1, but with hatch fill. Bad news: Same problem here. Good news: Can be also solved with my new method. Also checked with bitmap fill, same problem arises. This is more complicated to solve (and thus bad news); it also shows that metafile formats are really aged. I'm thinking again about a evtl. even more general solution for metafile-based exports... ALG: Implemented clipping for the bitmap-based actions, works well. Chekcing further usages (swf). Note: In swf, gradient gets 'grepped' from META_GRADIENTEX_ACTION using XGRAD_SEQ_BEGIN/XGRAD_SEQ_END. Note: Rotated GraphicObjects with bitmaps in metafiles work, non-rotated still painting over, check Metafile creation. ALG: Adapted for swf, added gradient actions to have unroated stuff correct. Both notes are done, all comment actions are handled now. looking for met (not very urgent, but nice to have)... ALG: Added preprocessing to met, done more checks. Found an error in VclMetafileProcessor2D (converter from primitives to metafile) in the MaskPrimitive2D handling; when resulting clip region is empty, do *mot* process sub-content, there can be no content. This may have lead to geometry in the metafile outside the clip regions. Testing... ALG: Okay, works. Also limited bitmap prescaling when directly handling FillGraphicPrimitive2D in VclProcessor2D to avoid performance problems. Pretty much done, doing some more tests... "alg" committed SVN revision 1402475 into trunk: #121267# added support for taking clipping into account for metafile-based ex... ALG: Okay, done. Hatch, bitmap and gradient fills in metafiles (roated or not) will now be clipped and exported in emf, wmf, swf and met file formats. Also done some speedups and fixes which came up during investigation. This needs thorough testing (all kinds of metafile graphics to mentioned export formats). It started as a temporary workaround for old filters based on metafiles as data transport format, but when you think about it noone will ever update emf/wmf exporters to primitives (maybe importers, though), so it is not only a short-term solution. Verified pass with trunk r1404513 |