summaryrefslogtreecommitdiffstats
path: root/src/uri-references.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-03-03 21:40:46 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-03-03 21:40:46 +0000
commite2a8d963d727bd0e6d93ea7f628a9ade542bf564 (patch)
tree8c3b2d77d75bfd9ab347584508f34c40595a34b2 /src/uri-references.cpp
parentupdate to trunk (diff)
parentcode cleanup (diff)
downloadinkscape-e2a8d963d727bd0e6d93ea7f628a9ade542bf564.tar.gz
inkscape-e2a8d963d727bd0e6d93ea7f628a9ade542bf564.zip
update to trunk
(bzr r11950.1.270)
Diffstat (limited to 'src/uri-references.cpp')
-rw-r--r--src/uri-references.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp
index 5cdf132fa..1da890c56 100644
--- a/src/uri-references.cpp
+++ b/src/uri-references.cpp
@@ -71,13 +71,15 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
if(document && uri.getPath() && !skip ) {
std::string base = document->getBase() ? document->getBase() : "";
std::string path = uri.getFullPath(base);
- if(!path.empty())
+ if(!path.empty()) {
document = document->createChildDoc(path);
- else
+ } else {
document = NULL;
+ }
}
if(!document) {
g_warning("Can't get document for referenced URI: %s", filename);
+ g_free( filename );
return;
}
g_free( filename );
@@ -91,7 +93,7 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
/* for now this handles the minimal xpointer form that SVG 1.0
* requires of us
*/
- gchar *id;
+ gchar *id = NULL;
if (!strncmp(fragment, "xpointer(", 9)) {
/* FIXME !!! this is wasteful */
/* FIXME: It looks as though this is including "))" in the id. I suggest moving
@@ -113,9 +115,7 @@ void URIReference::attach(const URI &uri) throw(BadURIException)
/* FIXME !!! validate id as an NCName somewhere */
- if (_uri) {
- delete _uri;
- }
+ delete _uri;
_uri = new URI(uri);
_connection.disconnect();
@@ -172,7 +172,7 @@ void URIReference::_release(SPObject *obj)
SPObject* sp_css_uri_reference_resolve( SPDocument *document, const gchar *uri )
{
- SPObject* ref = 0;
+ SPObject* ref = NULL;
if ( document && uri && ( strncmp(uri, "url(", 4) == 0 ) ) {
gchar *trimmed = extract_uri( uri );
@@ -188,7 +188,7 @@ SPObject* sp_css_uri_reference_resolve( SPDocument *document, const gchar *uri )
SPObject *
sp_uri_reference_resolve (SPDocument *document, const gchar *uri)
{
- SPObject* ref = 0;
+ SPObject* ref = NULL;
if ( uri && (*uri == '#') ) {
ref = document->getObjectById( uri + 1 );