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):
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.
Progress. If the call to setViewBoxIfMis sing() 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 DocumentPropert ies::onDocUnitC hange() in document- properties. cpp.
Both of these do this (in slightly different ways):
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.