summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35f10ad)
raw | patch | inline | side by side (parent: 35f10ad)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 3 Mar 2009 20:30:55 +0000 (20:30 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 3 Mar 2009 20:30:55 +0000 (20:30 +0000) |
src/filters/image.cpp | patch | blob | history |
diff --git a/src/filters/image.cpp b/src/filters/image.cpp
index 32afe5db66fecf106d3f4797d4fd67bd5e1e384b..eda815d8d881f3d785e6ec72b05757dd54180e13 100644 (file)
--- a/src/filters/image.cpp
+++ b/src/filters/image.cpp
{
SPFeImage *feImage = SP_FEIMAGE(object);
(void)feImage;
- Inkscape::URI *SVGElem_uri = NULL;
switch(key) {
/*DEAL WITH SETTING ATTRIBUTES HERE*/
case SP_ATTR_XLINK_HREF:
feImage->href = (value) ? g_strdup (value) : NULL;
if (!feImage->href) return;
try{
- SVGElem_uri = new Inkscape::URI(feImage->href);
+ Inkscape::URI SVGElem_uri(feImage->href);
feImage->SVGElemRef = new Inkscape::URIReference(feImage->document);
feImage->from_element = true;
- feImage->SVGElemRef->attach(*SVGElem_uri);
- feImage->SVGElem = SP_ITEM(feImage->SVGElemRef->getObject());
-
- delete SVGElem_uri;
- feImage->_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object));
- object->requestModified(SP_OBJECT_MODIFIED_FLAG);
- break;
+ feImage->SVGElemRef->attach(SVGElem_uri);
+ if (SPObject *elemref = feImage->SVGElemRef->getObject()) {
+ feImage->SVGElem = SP_ITEM(elemref);
+
+ feImage->_modified_connection = ((SPObject*) feImage->SVGElem)->connectModified(sigc::bind(sigc::ptr_fun(&sp_feImage_elem_modified), object));
+ object->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ break;
+ } else {
+ g_warning("SVG element URI was not found in the document while loading feImage");
+ }
}
catch(const Inkscape::UnsupportedURIException & e)
{