summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-11-29 00:37:30 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-11-29 00:37:30 +0000
commit32598fdd4d1e85228e46242d37f83c739591a078 (patch)
tree1ceb6e7e072e5be58bb917655eea9610b0e2104e /src
parentFix for 171466 : F/S set swatch preview column name (diff)
downloadinkscape-32598fdd4d1e85228e46242d37f83c739591a078.tar.gz
inkscape-32598fdd4d1e85228e46242d37f83c739591a078.zip
Fix for 1073128 : Command line PNG export fails if FeFlood filter primitive is present
(bzr r11913)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-filter-primitive.cpp3
-rw-r--r--src/inkscape.cpp4
-rw-r--r--src/main.cpp5
3 files changed, 10 insertions, 2 deletions
diff --git a/src/display/nr-filter-primitive.cpp b/src/display/nr-filter-primitive.cpp
index 93c6d4d6e..ce562668a 100644
--- a/src/display/nr-filter-primitive.cpp
+++ b/src/display/nr-filter-primitive.cpp
@@ -111,8 +111,7 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units)
// This is definitely a hack... but what else to do?
// Current viewport might not be document viewport... but how to find?
- SPDesktop* desktop = inkscape_active_desktop();
- SPDocument* document = sp_desktop_document(desktop);
+ SPDocument* document = inkscape_active_document();
SPRoot* root = document->getRoot();
Geom::Rect viewport;
if( root->viewBox_set ) {
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index fc9a9783f..fc823f8b7 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -1270,6 +1270,10 @@ inkscape_active_document (void)
{
if (SP_ACTIVE_DESKTOP) {
return sp_desktop_document (SP_ACTIVE_DESKTOP);
+ } else if (!inkscape->document_set.empty()) {
+ // If called from the command line there will be no desktop
+ // So 'fall back' to take the first listed document in the Inkscape instance
+ return inkscape->document_set.begin()->first;
}
return NULL;
diff --git a/src/main.cpp b/src/main.cpp
index 844aded56..be8049cf5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1032,6 +1032,9 @@ static int sp_process_file_list(GSList *fl)
g_warning("Specified document %s cannot be opened (does not exist or not a valid SVG file)", filename);
retVal++;
} else {
+
+ inkscape_add_document(doc);
+
if (sp_vacuum_defs) {
doc->vacuumDocument();
}
@@ -1099,6 +1102,8 @@ static int sp_process_file_list(GSList *fl)
do_query_dimension (doc, false, sp_query_x? Geom::X : Geom::Y, sp_query_id);
}
+ inkscape_remove_document(doc);
+
delete doc;
}
fl = g_slist_remove(fl, fl->data);