diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index edcea21a24cd757af5bfb77e28a2474ae9d61e37..6823f21229dca2aa254e9c291881538aeabe6593 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
#include <libnr/nr-matrix-div.h>
#include <libnr/nr-matrix-fns.h>
+#include "document.h"
#include "attributes.h"
#include "style.h"
#include "sp-rect.h"
SPRect *rect = SP_RECT(object);
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
- repr = sp_repr_new("svg:rect");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object));
+ repr = xml_doc->createElement("svg:rect");
}
sp_repr_set_svg_double(repr, "width", rect->width.computed);