Issue 102224 - export to StarView Metafile (.svm) is broken
Summary: export to StarView Metafile (.svm) is broken
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: save-export (show other issues)
Version: OOo 3.1
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: wolframgarten
QA Contact: issues@graphics
URL:
Keywords: regression
Depends on:
Blocks: 99999
  Show dependency tree
 
Reported: 2009-05-25 14:11 UTC by Regina Henschel
Modified: 2017-05-20 10:28 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2009-05-25 14:11:34 UTC
Take a Draw-document.
Draw an ellipse with some color filling. It does not matter which kind of
ellipse you use, classical or shape.
Mark ellipse and export with File > Export. Check "Selection" and chose filetype
"StarView Metafile".
Insert the generated Graphic via Insert > Picture.

Notice, that the Graphic is not round, but has straight line edges.

Expected: The Graphic looks like the source drawing.

Export is OK in OOo3.0.1 and broken in OOo3.1, so it is a regression.
Comment 1 wolframgarten 2009-05-25 14:19:12 UTC
Reproducible. Reassigned.
Comment 2 Regina Henschel 2009-05-29 20:19:03 UTC
Export to wmf, svg and met formats show the bug too.
Comment 3 sven.jacobi 2009-09-28 11:41:11 UTC
changed owner. sj->aw: please take a look.
Comment 4 Armin Le Grand 2009-09-28 13:00:43 UTC
AW: Taking a look. First test is to export to WMF and to look at the result with
pure WIN32 viewer. The error is there, too, so really the export is broken.
Debugging export...
Comment 5 Armin Le Grand 2009-09-28 13:10:10 UTC
AW: GraphicExporter is used, looking. Need VCL and tool siwth debug...
Comment 6 Armin Le Grand 2009-09-28 13:36:15 UTC
AW: Checked VclMetafileProcessor2D::processBasePrimitive2D, the case
PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D. The SvtGraphicFill and the
MetaFileAction both get the correct PolyPolygon with control points; the error
has to happen in the filter then. Need sfx2 with debug...
Comment 7 Armin Le Grand 2009-09-28 14:34:23 UTC
AW->SJ: The curve information is thrown away in WMFWriter::WMFRecord_PolyPolygon
when exporting to WMF. I guess this worked before since an Ellipse-Action was
used, not a PolyPolygon action.

I could re-add (not simple) code to again create ellipse actions, but this would
leave the error in WMFWriter::WMFRecord_PolyPolygon unsolved. This again happens
due to the use of Polygon::GetSimple(...) in tools which only detects curve
segments in a Polygon (the old tool spolygon) when the start and end point are
of type POLY_NORMAL. This is wrong and in poly.cxx (the same file) correct curve
segment detections exist.

AW->SJ: I think the best and simplest solution is to not use 'GetSimple(...)' in
the filters, but to use the also available (and always better)
'AdaptiveSubdivide(...)' instead. I am pretty sure GetSimple was only used since
AdaptiveSubdivide did not yet exist when the code was created.
Comment 8 Armin Le Grand 2009-09-28 14:34:52 UTC
AW: Added me to CC.
Comment 9 Armin Le Grand 2009-09-29 15:25:00 UTC
AW: Checked by calling inside Polygon::GetSimple directly AdaptiveSubdivide.
This shows that it works. BTW: There is no need not to replace GetSimple in
binfilter, too. So, GetSimple() could be removed completely, too...
Comment 10 sven.jacobi 2009-09-30 10:36:18 UTC
changed owner, because aw is already having a bugfix for this issue.
Comment 11 Armin Le Grand 2009-09-30 14:59:05 UTC
AW: Replacing GetSimple() completely with AdaptiveSubdivide, removing
GetSimple(). Test-building...
Comment 12 Armin Le Grand 2009-09-30 15:00:05 UTC
AW: Added to CWS impress178, test builds running (binfilter included...)...
Comment 13 Armin Le Grand 2009-09-30 17:12:36 UTC
AW; est build done, changes commited, finished. Need to check with finished version.
Comment 14 Armin Le Grand 2009-09-30 18:03:17 UTC
AW: met and wmf work now, but interestingly, svg and svm do not. Need to
continue debugging...
Comment 15 Armin Le Grand 2009-10-01 11:48:14 UTC
AW: Found in svg; the flags were not copied inside
SVGActionWriter::ImplWritePolyPolygon when the polygon was transformed using
ImplMap on each point...
CL said that .swf may have a similar problem since it's similar to svg export;
adding to the list.

All others: Please test as many exporters as possible. We need to find these
errors NOW (even when they are VERY old and all curved shapes are involved for a
looong time).

Open: swf, svm. Going on...
Comment 16 Armin Le Grand 2009-10-01 12:01:47 UTC
AW: swf works; in Writer::map( PolyPolygon& rPolyPolygon ) the error is not
repeated.

AW: svm does not work; strangely neither MetaPolygonAction::Write nor
MetaPolyPolygonAction::Write is used; someone seems to export to svm by hand.
Debugging...
Comment 17 Armin Le Grand 2009-10-01 12:32:26 UTC
AW: Indeed, svm is not written using the stream operators at the MetaActions,
but by a class called SVMConverter in VCL. And the helper methods
ImplWritePolyPolyAction and ImplWritePoly do NOT take care of curved
Polygons/PolyPolygons. I am really impressed that something like this was not
found in all those years :-(

Adapting those methods to at least use AdaptiveSubdivide on the Polygons before
wriwing the single points...
Comment 18 Armin Le Grand 2009-10-01 12:39:30 UTC
AW: Adapting ImplWritePolyPolyAction and ImplWritePoly was not enough; single
actions (e.g. MetaPolygonAction) get wrongly exported locally, too. Looking
deeper for curve ignoring places...
Comment 19 Armin Le Grand 2009-10-01 12:52:55 UTC
AW: All places adapted in SVMConverter, works as expected now. Commited, checked
on CWS.

AW: I wil now need to systematically check all export formats...
Comment 20 Armin Le Grand 2009-10-01 13:09:00 UTC
AW: All i could test look good and can now correctly export a curved polygon.
Checked on CWS version, done.
Comment 21 Armin Le Grand 2009-10-19 10:48:52 UTC
AW->WG: Checked in unxlngi6.pro version, works as expected. Please review.
Comment 22 wolframgarten 2009-10-20 13:39:53 UTC
Verified in CWS.