History log of /inkscape/src/extension/internal/wmf-inout.cpp
Revision Date Author Comments Expand
c1781cc5ed1fe8209c138c9634dc487c00a905a2 18-Feb-2016 mathog <>

provide end user debugging for EMF and WMF issues

089baf4cc94d795399ba8edb7c0a7807af901f1d 22-May-2015 mathog <>

minor tweaks to libUEMF and related code

15154a96861d033eb4878c31390f6255737171cd 08-May-2015 Marc Jeanmougin <marcjeanmougin@free.fr>

fixes a few of jenkins warnings

/inkscape/src/desktop.cpp /inkscape/src/display/canvas-arena.cpp /inkscape/src/document.cpp /inkscape/src/extension/implementation/script.cpp cairo-render-context.cpp wmf-inout.cpp /inkscape/src/file.cpp /inkscape/src/gradient-drag.cpp /inkscape/src/helper-fns.h /inkscape/src/helper/geom.cpp /inkscape/src/inkview.cpp /inkscape/src/libavoid/connector.cpp /inkscape/src/libavoid/graph.cpp /inkscape/src/libavoid/orthogonal.cpp /inkscape/src/live_effects/lpe-gears.cpp /inkscape/src/live_effects/lpe-taperstroke.cpp /inkscape/src/live_effects/parameter/filletchamferpointarray.cpp /inkscape/src/selection.cpp /inkscape/src/sp-item-transform.cpp /inkscape/src/trace/siox.cpp /inkscape/src/ui/dialog/document-properties.cpp /inkscape/src/ui/dialog/floating-behavior.cpp /inkscape/src/ui/dialog/grid-arrange-tab.cpp /inkscape/src/ui/dialog/icon-preview.cpp /inkscape/src/ui/interface.cpp /inkscape/src/ui/tools/box3d-tool.cpp /inkscape/src/ui/tools/flood-tool.cpp /inkscape/src/ui/tools/pen-tool.cpp /inkscape/src/ui/tools/pencil-tool.cpp /inkscape/src/ui/tools/rect-tool.cpp /inkscape/src/ui/tools/select-tool.cpp /inkscape/src/util/ziptool.cpp /inkscape/src/widgets/desktop-widget.cpp /inkscape/src/widgets/ege-adjustment-action.cpp /inkscape/src/widgets/gradient-vector.cpp
f8450d10ec3de270008a8a79bea5012114805f40 28-Apr-2015 mathog <>

enable default pen object for WMF files

06517eb74772b7c18a8ab8d703405646d9ec05d3 27-Apr-2015 mathog <>

patch for bugs 1447850 and 1447382

41fe3f808697419ddead60fc7bcc425166c05c26 26-Feb-2015 mathog <>

fix for bug 1425317

8a67a614a94c4fe15eeef7aa9cc692c168256058 09-Feb-2015 mathog <>

two typos in patch at rev 13914

680c76143b9a53386817a222607ce7b61e43709c 09-Feb-2015 mathog <>

fix for bug 1419926

f04e1d874e4b3956e4b162f2aedff3f035bbb111 09-Feb-2015 mathog <>

fix for bug 1405292

2d7e3411a6d25ef5810453c17fe591dcf04d5d05 04-Sep-2014 mathog <>

resolves bug 1348417 and implements addition features for bug 1302857

edc2f3b640cca99df088effceaa7da6273f4d8d4 30-Aug-2014 Alex Valavanis <valavanisalex@gmail.com>

Reduce header bloat

/inkscape/src/axis-manip.h /inkscape/src/desktop-events.h /inkscape/src/display/sp-canvas-item.h /inkscape/src/display/sp-canvas.h /inkscape/src/ege-adjustment-action.h /inkscape/src/ege-output-action.h /inkscape/src/ege-select-one-action.h /inkscape/src/extension/input.h emf-inout.cpp wmf-inout.cpp /inkscape/src/extension/output.h /inkscape/src/helper/action.h /inkscape/src/icon-size.h /inkscape/src/ink-action.h /inkscape/src/ink-comboboxentry-action.h /inkscape/src/knot.cpp /inkscape/src/knot.h /inkscape/src/proj_pt.h /inkscape/src/sp-pattern.h /inkscape/src/ui/dialog/clonetiler.h /inkscape/src/ui/dialog/export.h /inkscape/src/ui/dialog/filedialogimpl-gtkmm.cpp /inkscape/src/ui/tools/flood-tool.h /inkscape/src/ui/tools/select-tool.h /inkscape/src/ui/tools/spiral-tool.h /inkscape/src/ui/tools/text-tool.h /inkscape/src/ui/widget/unit-tracker.h /inkscape/src/widgets/button.cpp /inkscape/src/widgets/button.h /inkscape/src/widgets/eek-preview.h /inkscape/src/widgets/gradient-image.h /inkscape/src/widgets/gradient-selector.cpp /inkscape/src/widgets/gradient-selector.h /inkscape/src/widgets/gradient-vector.h /inkscape/src/widgets/paint-selector.h /inkscape/src/widgets/sp-color-icc-selector.h /inkscape/src/widgets/sp-color-notebook.h /inkscape/src/widgets/sp-color-scales.h /inkscape/src/widgets/sp-color-selector.h /inkscape/src/widgets/sp-color-slider.h /inkscape/src/widgets/sp-color-wheel-selector.h /inkscape/src/widgets/sp-widget.h /inkscape/src/widgets/sp-xmlview-content.h /inkscape/src/widgets/spinbutton-events.h /inkscape/src/widgets/toolbox.h
733052d0da88542a2fe64762c68ea8c433c0a0c1 28-Jul-2014 mathog <>

Fix for bug 1340683 for WMF input

4e47dd454b9d10cbca9ad0390cfbd176858287b8 22-Jul-2014 Markus Engel <markus.engel@tum.de>

Replaced some abs/fabs with std::abs.

ee2453b21ae671426e06077c5c2668099f7639d3 16-Jul-2014 Jon A. Cruz <jon@joncruz.org>

Warnings cleaup.

034d7ccaa6acbcd03e37974a2d164706862c32a2 29-Apr-2014 mathog <>

Improved support for clipping on EMF/WMF import, see bug 1302857

3b70d4b4adefa3ff65931070bee74f26bab2f6f6 28-Apr-2014 mathog <>

Fix for bug 1306138

ca85f4101a2ba0d627592c372cc5c6590c9cbd5f 27-Apr-2014 tavmjong-free <tavmjong@free.fr>

Replace 'memset' by constructors. Fixes segfault from turning SPStyle into a class. (WMF) modified: src/extension/internal/emf-inout.h src/extension/internal/wmf-inout.cpp src/extension/internal/wmf-inout.h unknown: .comments/ 1232425-fix-clang-warnings-mismatched-tags-SPStyle-r13299-v1.diff FILTERS/ RecentTextDecoChagnes.zip doxygen/ share/attributes/attindex.html share/attributes/propidx.html share/symbols/FlowSymbolsNew.svg src/cxxtests src/cxxtests.cpp src/cxxtests.log src/cxxtests.xml src/ui/dialog/symbols.cpp_new

2bf3910a9fbe18eb8fb519f02f9d49d68df7ee7a 25-Mar-2014 David Mathog <mathog@caltech.edu>

Patch for several issues in libuemf. ----- The patch: 1. Removes half a dozen or so code lines that didn't do anything. 2. Fixes a couple of missing tests for pointers which cannot be NULL. (Note that in many instances the pseudoobject functions in upmf.c do accept null pointers because the objects being constructed have optional parts.) 3. There was one "real" potential memory leak (line 6276 in upmf.c, numbers before the patch). I fixed the others too, but they just never happen (iconv would have to fail in some strange way.) There are no (real) memory access violations or memory leaks in any of this either in standalone libUEMF testing or in use as part of Inkscape as determined from valgrind runs.

d57de6ea6af46e3342199dea30d76e14388787b3 19-Mar-2014 mathog <mathog@caltech.edu>

WMF support: last piece of the code cleanup from bug #1248753

a2220686e6f3bc4aedd8140090696151d6cf1a00 11-Mar-2014 tavmjong-free <tavmjong@free.fr>

Change stroke-dasharray and stroke-dashoffset handling to match other properties. Split style.h into more manageable size files.

c8b4e479d9718f318510d74996cf05acc2d50f00 06-Mar-2014 mathog <mathog@caltech.edu>

WMF: fix for files with swapped W, H in the SETWINDOWEXT record EMF: code cleanup

5879527bc41c3d47f37440fb8b83edb9c48080cc 22-Feb-2014 mathog <mathog@caltech.edu>

Fix 'preserveAspectRatio' attribute of bitmap images in EMF/WMF import/export (bug #1278645).

5da08901f6f284dfb64e741ed2f6287d9cfc087a 08-Feb-2014 mathog <mathog@caltech.edu>

EMF/WMF support: Various changes (see bug #1263242 c35 for details) EMF support: - linear gradients: improve numeric stability on round-trip editing - linear gradients: fix scaling issue libTERE/text_reassemble update: - improve handling of whitespace created with large x kerns - fix handling of absolute RTL-positioning of LTR text in EMF files WMF support: - fix support for 'textout' records and Placeable headers - add support for CREATEPATTERNBRUSH - fix offset on load if opened via GUI (bug #1250250)

1df6105803c4c56c020a56301c7c9c4890fd4158 18-Jan-2014 mathog <mathog@caltech.edu>

libUEMF update; EMF linear gradient bug fixes (bug #1263242)

/inkscape/src/extension/CMakeLists.txt Makefile_insert emf-inout.cpp emf-inout.h emf-print.cpp emf-print.h metafile-inout.cpp metafile-inout.h metafile-print.cpp wmf-inout.cpp wmf-inout.h wmf-print.cpp /inkscape/src/libuemf/CMakeLists.txt /inkscape/src/libuemf/Makefile_insert /inkscape/src/libuemf/README /inkscape/src/libuemf/uemf.c /inkscape/src/libuemf/uemf.h /inkscape/src/libuemf/uemf_endian.c /inkscape/src/libuemf/uemf_endian.h /inkscape/src/libuemf/uemf_print.c /inkscape/src/libuemf/uemf_print.h /inkscape/src/libuemf/uemf_utf.c /inkscape/src/libuemf/uemf_utf.h /inkscape/src/libuemf/upmf.c /inkscape/src/libuemf/upmf.h /inkscape/src/libuemf/upmf_print.c /inkscape/src/libuemf/upmf_print.h /inkscape/src/libuemf/uwmf.c /inkscape/src/libuemf/uwmf.h /inkscape/src/libuemf/uwmf_endian.c /inkscape/src/libuemf/uwmf_endian.h /inkscape/src/libuemf/uwmf_print.c /inkscape/src/libuemf/uwmf_print.h
4fc7a23ef0b6698dd83abb08a7a34402e90a1235 08-Jan-2014 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

fix warnings

bcc1460075bacc93179de32bbc59afd79f8ec389 27-Oct-2013 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

add some nullptr checking, should fix crash (couldn't test)

fc7bd82fba00cc9b3c954c2c52bb884af45d633f 27-Oct-2013 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

fix crash, partly fix vertical positioning issue. couldn't figure out how to make it work, the applied scale transform works weird somehow

afd7c85433b4a2c51f2f9d87fe6fa91e88cae2c1 26-Oct-2013 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

fix crash

4d9174d978780bc085bbbe9c6c69a99ad30724df 25-Oct-2013 mathog <mathog@caltech.edu>

WMF import: fix scaling of files without ViewPort record (see bug 1241783, comment 4-5)

6962f793fc5f7459347a51332a60d962f1035d38 24-Oct-2013 mathog <mathog@caltech.edu>

Fix for Bug 1243937 (EMF import, diagram obscured by full page rectangle)

28c3a9de9a8b7b5f345447ef581218d2b7751cb7 24-Oct-2013 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

fix bug "some of the locale-based templates cause objects to be resized when default units are changed" #1236257

87b68db8c76e3425a99bb2f05c70d7b25c50b654 13-Oct-2013 Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>

Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ?

/inkscape/src/arc-context.cpp /inkscape/src/display/canvas-axonomgrid.cpp /inkscape/src/display/canvas-grid.cpp /inkscape/src/display/canvas-grid.h /inkscape/src/document.cpp emf-inout.cpp wmf-inout.cpp /inkscape/src/live_effects/parameter/unit.cpp /inkscape/src/lpe-tool-context.cpp /inkscape/src/pen-context.cpp /inkscape/src/preferences.cpp /inkscape/src/rect-context.cpp /inkscape/src/seltrans.cpp /inkscape/src/sp-guide.cpp /inkscape/src/sp-namedview.cpp /inkscape/src/sp-namedview.h /inkscape/src/sp-text.cpp /inkscape/src/spiral-context.cpp /inkscape/src/star-context.cpp /inkscape/src/text-context.cpp /inkscape/src/ui/dialog/clonetiler.cpp /inkscape/src/ui/dialog/document-properties.cpp /inkscape/src/ui/dialog/export.cpp /inkscape/src/ui/dialog/guides.cpp /inkscape/src/ui/tool/node.cpp /inkscape/src/ui/widget/page-sizer.cpp /inkscape/src/ui/widget/page-sizer.h /inkscape/src/ui/widget/preferences-widget.cpp /inkscape/src/ui/widget/registered-widget.h /inkscape/src/ui/widget/scalar-unit.cpp /inkscape/src/ui/widget/scalar-unit.h /inkscape/src/ui/widget/selected-style.cpp /inkscape/src/ui/widget/selected-style.h /inkscape/src/ui/widget/spinbutton.cpp /inkscape/src/ui/widget/style-swatch.cpp /inkscape/src/ui/widget/unit-menu.cpp /inkscape/src/ui/widget/unit-menu.h /inkscape/src/ui/widget/unit-tracker.cpp /inkscape/src/ui/widget/unit-tracker.h /inkscape/src/util/expression-evaluator.cpp /inkscape/src/util/expression-evaluator.h /inkscape/src/util/units.cpp /inkscape/src/util/units.h /inkscape/src/widgets/desktop-widget.cpp /inkscape/src/widgets/lpe-toolbar.cpp /inkscape/src/widgets/measure-toolbar.cpp /inkscape/src/widgets/node-toolbar.cpp /inkscape/src/widgets/paintbucket-toolbar.cpp /inkscape/src/widgets/rect-toolbar.cpp /inkscape/src/widgets/ruler.cpp /inkscape/src/widgets/ruler.h /inkscape/src/widgets/select-toolbar.cpp /inkscape/src/widgets/stroke-style.cpp /inkscape/src/widgets/stroke-style.h
86df60ed2c0ede4dad6684c75acd907f6146c1b6 09-Oct-2013 JazzyNico <nicoduf@yahoo.fr>

Documentation/Translation. Fix for Bug #1236382 (Typos in comments and message, localization context needed) by Yuri Chornoivan.

c4162fcc5a3c05e1b5d56115f40b60b88b956138 05-Oct-2013 Matthew Petroff <matthew@mpetroff.net>

Fix EMF/WMF import scale (Bug #1229120).

87d2ee3b16068e03b26a409994b73605fde664a6 22-Sep-2013 Matthew Petroff <matthew@mpetroff.net>

Fix adding viewBox to new documents.

453a8671e6992250324846d0b76f02801221c760 15-Sep-2013 Matthew Petroff <matthew@mpetroff.net>

Improved code readability.

1710c8729db34263e50b443e7fcf541d3cffa005 02-Sep-2013 Krzysztof Kosiński <tweenk.pl@gmail.com>

Unduplicate some code in the metafile printing extensions

6a55cc6751be1162fa737fa656ffae0729c2e2a0 31-Aug-2013 Krzysztof Kosiński <tweenk.pl@gmail.com>

Move libuemf to a separate directory. Rename libunicode-convert to symbol_convert and put it in libuemf.

/inkscape/configure.ac /inkscape/po/POTFILES.in /inkscape/src/CMakeLists.txt /inkscape/src/Makefile.am Makefile_insert emf-inout.cpp emf-inout.h emf-print.cpp emf-print.h text_reassemble.c wmf-inout.cpp wmf-inout.h wmf-print.cpp wmf-print.h /inkscape/src/libnrtype/Layout-TNG-Output.cpp /inkscape/src/libuemf/CMakeLists.txt /inkscape/src/libuemf/Makefile_insert /inkscape/src/libuemf/README /inkscape/src/libuemf/makefile.in /inkscape/src/libuemf/symbol_convert.c /inkscape/src/libuemf/symbol_convert.h /inkscape/src/libuemf/uemf.c /inkscape/src/libuemf/uemf.h /inkscape/src/libuemf/uemf_endian.c /inkscape/src/libuemf/uemf_endian.h /inkscape/src/libuemf/uemf_print.c /inkscape/src/libuemf/uemf_print.h /inkscape/src/libuemf/uemf_utf.c /inkscape/src/libuemf/uemf_utf.h /inkscape/src/libuemf/uwmf.c /inkscape/src/libuemf/uwmf.h /inkscape/src/libuemf/uwmf_endian.c /inkscape/src/libuemf/uwmf_endian.h /inkscape/src/libuemf/uwmf_print.c /inkscape/src/libuemf/uwmf_print.h /inkscape/src/libunicode-convert/Makefile_insert /inkscape/src/libunicode-convert/README /inkscape/src/style.h
aefaed7646cce60b4b2d4b2f7411234949539482 29-Aug-2013 ~suv <suv-sf@users.sourceforge.net>

adapt to changes in r12471 (unit refactoring)

9a8ade3834e2a67c1d95bcfc900ab36be37a03a5 19-Jun-2013 David Mathog <>

changes_2013_05_22a.patch: 1. Resolves issue of bug #988601 message 170 (Support of 'Unset' styles in EMF export). 2. Implements CSS 3 (and CSS 2) text-decoration support. Note that it does not yet provide any method of adding these features - at present it just shows whatever is in the SVG. This new code is also used to display EMF/WMF strike-through and underline text decorations when these files are read in. Those decorations may also be written out to EMF/WMF. Other text decoration features, like overline, or dotted lines, are dropped. For SVG text-decoration -line, -style, -color are all implemented. CSS3 provides two ways to represent the same state, this code uses the compound text-decoration method rather than the 3 fields method. Also it leaves out keywords that are not needed and would break backwards compatibility. For instance: text-decoration: underline solid is valid, but would break CSS2. Solid is the default, so that sort of case is written as: text-decoration: underline If the state is CSS3 specific all of the needed fields are of course include, like text-decoration: underline wavy red 3. It incorporates the fix for bug 1181326 (Text edit mishandles span of just colored spaces) 4. It incorporates further changes to text editing so that style can be changed on spans consisting of only spaces when text decorations are present in the span. 5. It incorporates code to disable text decorations when text so marked is mapped onto a path. 6. Fixed more bugs in Hebrew language support than I can remember. Hebrew language export/import to EMF now works quite well. (See the examples in libTERE v 0.7.) WMF does not support unicode and for all intents and purposes Inkscape has no way to read or write Hebrew to it. Some of more important things that now work that didn't (or didn't always): Hebrew diacritical marks, R/L/center justification, and bidirectional text. The Hebrew fonts "Ezra SIL" and "EZRA SIL SR" should be installed before viewing the libTERE examples, otherwise font substitutions will cause some text shifts. 7. Implemented font failover in Text Reassemble, which makes the process more robust. (Again, see the examples in libTERE. )

089478b5b462b98a7ecb34496c6f15eb315b9a18 21-Mar-2013 David Mathog <>

988601-changes_2013_03_20a.patch 1. Fixes the clang warnings noted in a post above, other than those associated with alignment caused by casting. 2. Fixes some minor rounding errors in both WMF and EMF input/output. Round trip open/save cycles are conservative for EMF and WMF files (excluding any features that are not full supported in inkscape or the target file format, for instance, gradients, which must be emulated.) 3. Fixed a missing break in the input WMF LINETO record handling, which was falling through into the MOVETO and generating a harmless extra "M" operation in a path. 4. WMF has no POLYPOLYLINE record. However input that maps into essentially a polypolyline record in SVG is common, for instance dashed lines that have been converted to line segments. These end up in SVG as a series of M L M L draw commands in the path. Earlier each M L pair was going out as a polyline record, now they go as a series of MOVETO/LINETO records. The primary reason for this change is that without this change the behavior described in (2) does not occur. 5. Fixed an issue where polyline and polygon records in some instances ended up with an extra copy of their last point.

53fcf2d334db9415d13a8a4e54c994b315689963 19-Mar-2013 ~suv <suv-sf@users.sourceforge.net>

INX: fix typo in internal WMF input/output filetypename

5530d4cb2db040e48228f2f4a525e3dabb15b057 19-Mar-2013 David Mathog <>

changes_2013_03_18c.patch This set of patches does the following: 1. Fixed a typo ( where "+ sizeof()" should have been "* sizeof()") which caused a memory problem for EMF/WMF files with very large numbers of hatches. 2. Added support for background mode, background color, and textcolor in hatches. EMF/WMF files change these parameters but the change may be silent until many records later. This has the odd effect that a stroke or fill may be defined (in SVG) and then it is ignored later and replaced with one with a different background color. 3. Fixed WMF output so that it wasn't adding +1 to the number of pixels for Width and Height. (Allows WMF files to go through several cycles of save as, open without changing sizes.) 4. Cleaned up indenting of [ew]mf-{print|inout}.* files, to make them compliant with the inkscape standard. All indents are (I hope) now 4*i deep. 5. Added underline/strikeout support for text read from EMF/WMF files. Inkscape itself cannot currently render this, but it makes it into the SVG, and it shows up correctly when that SVG is read by Opera. 6. Took out all the "throw" calls, replacing them with g_error(). If this comes up again in debugging a define can be used to remap the g_error to temporarily reintroduce the throw so that gdb can catch them. 7. Took out the "%6lf" format changes from patch 11724, retained the "127" length limit in the same sscanf. 8. Put the C type casts back in, reversing those changes from patch 11724. This is a style issue, and I could not find clear guidance for which way to go. (Nor a good rationale for keeping the lengthier C++ syntax.) So I reviewed a large swath of other inkscape code to see if there was a trend and found a very large number of other sections that were using C style casts instead of the more verbose C++ forms. So I kept it the way it has been. 9. The locale changes from 11724 were of course retained.

10b77f97a176647caa068363224704062325ec4a 08-Mar-2013 David Mathog <>

changes_2013_02_25a.patch New: WMF import/export implements WMF (Windows Metafile) read and write. Inkscape previously supported that through uniconverter, which was not very good with WMF files. The new version now has a complete wmf-print/wmf-inout implementation, analogous to the previous emf-print/emf-inout. This handles images, patterns, and various other goodies to the extent that WMF does. WMF is a bit primitive, many fields are only 16 bits, so it even more resolution sapping issues than does EMF. Given the choice, always use the latter format.