Comment 14 for bug 1348417

Revision history for this message
David Mathog (mathog) wrote :

Progress. If the call to setViewBoxIfMissing() in emf-inout.cpp AFTER the createDocFromMem() is commented out then the SVG produced is identical to what it would be if the SVG is read in from a file. That is, no viewbox is defined when the
SVG is saved. So createDoc vs. createDocFromMem() is a red herring, the problem happens after those calls.

I do not recall why/when setViewBoxIfMissing was added, but its internals are mostly the same as DocumentProperties::onDocUnitChange() in document-properties.cpp.

Both of these do this (in slightly different ways):

        doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, dh));

If getRoot() does not include defs, or for some reason it skips the defs, then it explains perfectly why the emf input objects no longer match the defs.