From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/xml/repr-io.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/xml/repr-io.cpp') diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index 6977bc1e2..5f576d00f 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -11,7 +11,7 @@ */ #ifdef HAVE_CONFIG_H -# include +#include #endif #include @@ -39,7 +39,6 @@ #include "preferences.h" #include -#include using Inkscape::IO::Writer; using Inkscape::Util::List; -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/xml/repr-io.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/xml/repr-io.cpp') diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index 5f576d00f..6977bc1e2 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -11,7 +11,7 @@ */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include @@ -39,6 +39,7 @@ #include "preferences.h" #include +#include using Inkscape::IO::Writer; using Inkscape::Util::List; -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/xml/repr-io.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/xml/repr-io.cpp') diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index 6977bc1e2..5f576d00f 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -11,7 +11,7 @@ */ #ifdef HAVE_CONFIG_H -# include +#include #endif #include @@ -39,7 +39,6 @@ #include "preferences.h" #include -#include using Inkscape::IO::Writer; using Inkscape::Util::List; -- cgit v1.2.3 From a920c6186d15be3386066c365c6e7b7ae74e4caf Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 4 Jan 2017 22:07:53 +0200 Subject: Remove some code that doesn't do anything. There was a comment to this effect there. (bzr r15369.1.13) --- src/xml/repr-io.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/xml/repr-io.cpp') diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index 5f576d00f..ae6f238d4 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -1008,28 +1008,6 @@ void sp_repr_write_stream_element( Node * repr, Writer & out, add_whitespace = false; } - // THIS DOESN'T APPEAR TO DO ANYTHING. Can it be commented out or deleted? - { - GQuark const href_key = g_quark_from_static_string("xlink:href"); - //GQuark const absref_key = g_quark_from_static_string("sodipodi:absref"); - - gchar const *xxHref = 0; - //gchar const *xxAbsref = 0; - for ( List ai(attributes); ai; ++ai ) { - if ( ai->key == href_key ) { - xxHref = ai->value; - //} else if ( ai->key == absref_key ) { - //xxAbsref = ai->value; - } - } - - // Might add a special case for absref but no href. - if ( old_href_base && new_href_base && xxHref ) { - //g_message("href rebase test with [%s] and [%s]", xxHref, xxAbsref); - //std::string newOne = rebase_href_attrs( old_href_base, new_href_base, xxHref, xxAbsref ); - } - } - for ( List iter = rebase_href_attrs(old_href_base, new_href_base, attributes); iter ; ++iter ) -- cgit v1.2.3 From 112f963fb12a941762c828dfd1690a61771516af Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 30 Apr 2017 19:06:29 +0200 Subject: Relax any hardcoded limit from the libxml2 parser when creating documents from memory This fixes many bugs (mostly caused by very long image data URIs) Fixed bugs: - https://launchpad.net/bugs/1572280 - https://launchpad.net/bugs/1412912 - https://launchpad.net/bugs/1373322 - https://launchpad.net/bugs/1243011 - https://launchpad.net/bugs/1627004 - https://launchpad.net/bugs/1627004 (bzr r15654) --- src/xml/repr-io.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/xml/repr-io.cpp') diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index ae6f238d4..d8e0f5418 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -404,7 +404,12 @@ Document *sp_repr_read_mem (const gchar * buffer, gint length, const gchar *defa g_return_val_if_fail (buffer != NULL, NULL); - doc = xmlParseMemory (const_cast(buffer), length); + int parser_options = XML_PARSE_HUGE | XML_PARSE_RECOVER; + parser_options |= XML_PARSE_NONET; // TODO: should we allow network access? + // proper solution would be to check the preference "/options/externalresources/xml/allow_net_access" + // as done in XmlSource::readXml which gets called by the analogous sp_repr_read_file() + // but sp_repr_read_mem() seems to be called in locations where Inkscape::Preferences::get() fails badly + doc = xmlReadMemory (const_cast(buffer), length, NULL, NULL, parser_options); rdoc = sp_repr_do_read (doc, default_ns); if (doc) { -- cgit v1.2.3