diff options
Diffstat (limited to 'src/widgets/gradient-selector.cpp')
| -rw-r--r-- | src/widgets/gradient-selector.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 3177700c3..68d69f3f9 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -22,6 +22,7 @@ #include <gtk/gtkmenuitem.h> #include <gtk/gtktooltips.h> +#include "document.h" #include "../document-private.h" #include "../gradient-chemistry.h" @@ -312,14 +313,15 @@ sp_gradient_selector_add_vector_clicked (GtkWidget *w, SPGradientSelector *sel) if (gr) { repr = SP_OBJECT_REPR (gr)->duplicate(); } else { + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *stop; - repr = sp_repr_new ("svg:linearGradient"); - stop = sp_repr_new ("svg:stop"); + repr = xml_doc->createElement("svg:linearGradient"); + stop = xml_doc->createElement("svg:stop"); stop->setAttribute("offset", "0"); stop->setAttribute("style", "stop-color:#000;stop-opacity:1;"); repr->appendChild(stop); Inkscape::GC::release(stop); - stop = sp_repr_new ("svg:stop"); + stop = xml_doc->createElement("svg:stop"); stop->setAttribute("offset", "1"); stop->setAttribute("style", "stop-color:#fff;stop-opacity:1;"); repr->appendChild(stop); |
