diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-03-03 21:40:46 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-03-03 21:40:46 +0000 |
| commit | e2a8d963d727bd0e6d93ea7f628a9ade542bf564 (patch) | |
| tree | 8c3b2d77d75bfd9ab347584508f34c40595a34b2 /src | |
| parent | update to trunk (diff) | |
| parent | code cleanup (diff) | |
| download | inkscape-e2a8d963d727bd0e6d93ea7f628a9ade542bf564.tar.gz inkscape-e2a8d963d727bd0e6d93ea7f628a9ade542bf564.zip | |
update to trunk
(bzr r11950.1.270)
Diffstat (limited to 'src')
| -rw-r--r-- | src/document-private.h | 2 | ||||
| -rw-r--r-- | src/document.cpp | 35 | ||||
| -rw-r--r-- | src/sp-object.h | 8 | ||||
| -rw-r--r-- | src/uri-references.cpp | 16 | ||||
| -rw-r--r-- | src/widgets/font-selector.cpp | 4 |
5 files changed, 32 insertions, 33 deletions
diff --git a/src/document-private.h b/src/document-private.h index 35f21910c..4560aa28f 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -61,7 +61,7 @@ struct SPDocumentPrivate { SPDocument::CommitSignal commit_signal; /* Undo/Redo state */ - bool sensitive: true; /* If we save actions to undo stack */ + bool sensitive; /* If we save actions to undo stack */ Inkscape::XML::Event * partial; /* partial undo log when interrupted */ int history_size; GSList * undo; /* Undo stack of reprs */ diff --git a/src/document.cpp b/src/document.cpp index 18e626b5b..d71fd97df 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -92,20 +92,20 @@ SPDocument::SPDocument() : keepalive(FALSE), virgin(TRUE), modified_since_save(FALSE), - rdoc(0), - rroot(0), - root(0), + rdoc(NULL), + rroot(NULL), + root(NULL), style_cascade(cr_cascade_new(NULL, NULL, NULL)), - uri(0), - base(0), - name(0), - priv(0), // reset in ctor + uri(NULL), + base(NULL), + name(NULL), + priv(NULL), // reset in ctor actionkey(), modified_id(0), rerouting_handler_id(0), - profileManager(0), // deferred until after other initialization + profileManager(NULL), // deferred until after other initialization router(new Avoid::Router(Avoid::PolyLineRouting|Avoid::OrthogonalRouting)), - _collection_queue(0), + _collection_queue(NULL), oldSignalsConnected(false), current_persp3d(NULL), current_persp3d_impl(NULL), @@ -124,7 +124,7 @@ SPDocument::SPDocument() : p->resources = g_hash_table_new(g_str_hash, g_str_equal); - p->sensitive = FALSE; + p->sensitive = false; p->partial = NULL; p->history_size = 0; p->undo = NULL; @@ -511,8 +511,7 @@ SPDocument *SPDocument::createChildDoc(std::string const &uri) */ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, bool make_new, SPDocument *parent) { - SPDocument *doc; - Inkscape::XML::Document *rdoc; + Inkscape::XML::Document *rdoc = NULL; gchar *base = NULL; gchar *name = NULL; @@ -554,7 +553,7 @@ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, b //# These should be set by now g_assert(name); - doc = createDoc(rdoc, uri, base, name, keepalive, parent); + SPDocument *doc = createDoc(rdoc, uri, base, name, keepalive, parent); g_free(base); g_free(name); @@ -564,7 +563,7 @@ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, b SPDocument *SPDocument::createNewDocFromMem(gchar const *buffer, gint length, unsigned int keepalive) { - SPDocument *doc = 0; + SPDocument *doc = NULL; Inkscape::XML::Document *rdoc = sp_repr_read_mem(buffer, length, SP_SVG_NS_URI); if ( rdoc ) { @@ -762,7 +761,7 @@ void SPDocument::setBase( gchar const* base ) { if (this->base) { g_free(this->base); - this->base = 0; + this->base = NULL; } if (base) { this->base = g_strdup(base); @@ -771,9 +770,9 @@ void SPDocument::setBase( gchar const* base ) void SPDocument::do_change_uri(gchar const *const filename, bool const rebase) { - gchar *new_base = 0; - gchar *new_name = 0; - gchar *new_uri = 0; + gchar *new_base = NULL; + gchar *new_name = NULL; + gchar *new_uri = NULL; if (filename) { #ifndef WIN32 diff --git a/src/sp-object.h b/src/sp-object.h index 3faadb404..cf18d4523 100644 --- a/src/sp-object.h +++ b/src/sp-object.h @@ -685,18 +685,18 @@ public: unsigned getPosition(); - gchar const * getAttribute(gchar const *name,SPException *ex=0) const; + gchar const * getAttribute(gchar const *name,SPException *ex=NULL) const; void appendChild(Inkscape::XML::Node *child); - void addChild(Inkscape::XML::Node *child,Inkscape::XML::Node *prev=0); + void addChild(Inkscape::XML::Node *child,Inkscape::XML::Node *prev=NULL); /** * Call virtual set() function of object. */ void setKeyValue(unsigned int key, gchar const *value); - void setAttribute(gchar const *key, gchar const *value, SPException *ex=0); + void setAttribute(gchar const *key, gchar const *value, SPException *ex=NULL); /** * Read value of key attribute from XML node into object. @@ -705,7 +705,7 @@ public: gchar const *getTagName(SPException *ex) const; - void removeAttribute(gchar const *key, SPException *ex=0); + void removeAttribute(gchar const *key, SPException *ex=NULL); /** * Returns an object style property. 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 ); diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index 5f9098d44..0e862638c 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -295,7 +295,7 @@ static void sp_font_selector_family_select_row(GtkTreeSelection *selection, // Next get family name with its style list gchar *family; - GList *list=0; + GList *list=NULL; gtk_tree_model_get (model, &iter, 0, &family, 1, &list, -1); // Find best style match for selected family with current style (e.g. of selected text). @@ -418,7 +418,7 @@ static void sp_font_selector_emit_set (SPFontSelector *fsel) GtkTreeModel *model_style; GtkTreeIter iter_family; GtkTreeIter iter_style; - char *family=0, *style=0; + char *family=NULL, *style=NULL; //We need to check this here since most GtkTreeModel operations are not atomic //See GtkListStore documenation, Chapter "Atomic Operations" --mderezynski |
