When opening a raster image (like png), we were loading the output extension for that image and trying to call its save() method, which did nothing because raster output extensions don't define that method.
Such extensions are designed for the export-as flow and provide the export_raster method instead.
Determining which extension to use for saving a file was also happening too low in the stack, after the save filename had already been chosen and where it was awkward to switch to a save-as approach.
So I've added some logic to determine which extension to use ahead of time (and ignoring raster output extensions for this) and also switch the save filename to use the target extension.
Now Inkscape::Extension::save requires an extension argument and does not support autodetection (that autodetection is handled a layer up).
And some related cleanups:
- If an Output extension ever does have its save() method called, we now display a user error instead of simply actingn like it worked. This is done by throwing an exception in the default handler.
- The extension error messages were using GLib::ustring::compose instead of GLib::ustring::sprintf, so the filenames weren't being injected. This is now fixed.
- Previously if save() failed (even on a user cancel), you'd still get shown the save-as dialog. Which doesn't really make sense. You only want to see that if we don't know how to save the current extension.
Fixes #2667









