mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 21:12:57 -05:00
Paste on Windows never read the enhanced metafile that CAD and office
apps put on the clipboard as vector art: windows_formats had no entry for
EMF, so the app pasted their bitmap instead, or nothing. The Windows
clipboard holds an EMF as a handle (CF_ENHMETAFILE, which Windows also
makes from CF_METAFILEPICT), so the app now copies its records with
GetEnhMetaFileBits, at most 64 MiB, and pastes them through
clipboard.importEmf.
A .dxf, .dwg or HP-GL plot file copied in a file manager did not paste,
because file_flavour had no flavour for them, though Open and Place read
all three. They now paste as image/vnd.dxf, image/vnd.dwg and
application/vnd.hp-hpgl through the new command clipboard.importCad
{dataBase64, format: dxf|dwg|hpgl, center?}, read as document.open reads
the file. A file pastes this way only when its bytes are the format, so
a chart script named .plt is not taken for a plot.
Fixes #10819.