Comment 1 for bug 230498

Revision history for this message
Mark Burton (mj-burton) wrote :

The problem that causes this is in the file export.cpp in the function sp_export_export_clicked (GtkButton */*button*/, GtkObject *base).

The issue is in the funciton call to sp_export_png_file().

                    if (!sp_export_png_file (sp_desktop_document (SP_ACTIVE_DESKTOP), fn,
                                             *area, width, height, dpi, dpi,
                                             nv->pagecolor,
                                             NULL, NULL, TRUE, // overwrite without asking
                                             hide ? (GSList *) sp_desktop_selection(SP_ACTIVE_DESKTOP)->itemList() : NULL
                            )) {

In the case when "hide" is set to true, the complete list of selected items is passed to this funciton, when in fact only the object being redered to file should be passed. The comment in the funciton header for hide_other_items_recursively() confirms this (see file pixbuff-ops.cpp). Its says:-

"Hide all items that are not listed in list, recursively, skipping groups and defs."

I made a quick fix, and convinced myself this works. The same error appears later on in the same funciton, but for non-batch export.

This whole batch export routine could really do with some more thought. The way *hints* are used for dpi and export filename in a way that the user cannot easily recognise and understand does not give the best user experience.