diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-03 11:38:35 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-03 11:38:35 +0000 |
| commit | b4efe9a08f442b8149978edbcbd4f627a0758249 (patch) | |
| tree | bc9f46861458733ffee64d38f6e6db2e33d945c5 /src | |
| parent | libcroco: Merge upstream 0.6.5 changes (diff) | |
| download | inkscape-b4efe9a08f442b8149978edbcbd4f627a0758249.tar.gz inkscape-b4efe9a08f442b8149978edbcbd4f627a0758249.zip | |
libcroco: Merge upstream 0.6.6 changes
(bzr r12768)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcroco/cr-om-parser.c | 17 | ||||
| -rw-r--r-- | src/libcroco/cr-string.c | 8 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src/libcroco/cr-om-parser.c b/src/libcroco/cr-om-parser.c index dd6cacc06..8eb37306b 100644 --- a/src/libcroco/cr-om-parser.c +++ b/src/libcroco/cr-om-parser.c @@ -143,7 +143,7 @@ static enum CRStatus cr_om_parser_init_default_sac_handler (CROMParser * a_this) { CRDocHandler *sac_handler = NULL; - gboolean free_hdlr_if_error = FALSE; + gboolean created_handler = FALSE; enum CRStatus status = CR_OK; g_return_val_if_fail (a_this && PRIVATE (a_this) @@ -156,7 +156,7 @@ cr_om_parser_init_default_sac_handler (CROMParser * a_this) if (!sac_handler) { sac_handler = cr_doc_handler_new (); - free_hdlr_if_error = TRUE; + created_handler = TRUE; } /* @@ -178,15 +178,10 @@ cr_om_parser_init_default_sac_handler (CROMParser * a_this) sac_handler->end_media = end_media; sac_handler->import_style = import_style; - status = cr_parser_set_sac_handler (PRIVATE (a_this)->parser, - sac_handler); - if (status == CR_OK) { - return CR_OK; - } - - if (sac_handler && free_hdlr_if_error == TRUE) { - cr_doc_handler_destroy (sac_handler); - sac_handler = NULL; + if (created_handler) { + status = cr_parser_set_sac_handler (PRIVATE (a_this)->parser, + sac_handler); + cr_doc_handler_unref (sac_handler); } return status; diff --git a/src/libcroco/cr-string.c b/src/libcroco/cr-string.c index 03a50f66e..47d557d5b 100644 --- a/src/libcroco/cr-string.c +++ b/src/libcroco/cr-string.c @@ -76,10 +76,10 @@ cr_string_new_from_gstring (GString const *a_string) return NULL ; } if (a_string) { - result->stryng = g_string_new_len - (a_string->str, a_string->len) ; - } else { - result->stryng = g_string_new (NULL) ; + g_string_append_len (result->stryng, + a_string->str, + a_string->len); + } return result ; } |
