[yast-commit] r55561 - in /branches/SuSE-Code-11-Branch/gtk: ChangeLog VERSION package/yast2-gtk.changes src/YGUtils.cc src/test.cc
![](https://seccdn.libravatar.org/avatar/dabe76abe169ca795e79b874afca002e.jpg?s=120&d=mm&r=g)
Author: mkudlvasr Date: Tue Feb 17 16:35:29 2009 New Revision: 55561 URL: http://svn.opensuse.org/viewcvs/yast?rev=55561&view=rev Log: bacport of mmeeks changes in trunk (r55491) Modified: branches/SuSE-Code-11-Branch/gtk/ChangeLog branches/SuSE-Code-11-Branch/gtk/VERSION branches/SuSE-Code-11-Branch/gtk/package/yast2-gtk.changes branches/SuSE-Code-11-Branch/gtk/src/YGUtils.cc branches/SuSE-Code-11-Branch/gtk/src/test.cc Modified: branches/SuSE-Code-11-Branch/gtk/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/gtk/ChangeLog?rev=55561&r1=55560&r2=55561&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/gtk/ChangeLog (original) +++ branches/SuSE-Code-11-Branch/gtk/ChangeLog Tue Feb 17 16:35:29 2009 @@ -1,3 +1,9 @@ +2009-02-17 Martin Kudlvasr <mkudlvasr@novell.com> + + * backport of mmeeks changes in trunk (r55491), + fixes (475275) + * Version 2.17.11 + 2009-02-12 Martin Kudlvasr <mkudlvasr@novell.com> * Version 2.17.10 Modified: branches/SuSE-Code-11-Branch/gtk/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/gtk/VERSION?rev=55561&r1=55560&r2=55561&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/gtk/VERSION (original) +++ branches/SuSE-Code-11-Branch/gtk/VERSION Tue Feb 17 16:35:29 2009 @@ -1 +1 @@ -2.17.10 +2.17.11 Modified: branches/SuSE-Code-11-Branch/gtk/package/yast2-gtk.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/gtk/package/yast2-gtk.changes?rev=55561&r1=55560&r2=55561&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/gtk/package/yast2-gtk.changes (original) +++ branches/SuSE-Code-11-Branch/gtk/package/yast2-gtk.changes Tue Feb 17 16:35:29 2009 @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Feb 17 16:07:14 CET 2009 - mkudlvasr@suse.cz + +- fix for wrong handling of & in gtk widgets (bnc#475275) + * 2.17.11 + +------------------------------------------------------------------- Thu Feb 12 18:48:25 CET 2009 - mkudlvasr@suse.cz - new version on behalf of Ricardo: 2.17.10 Modified: branches/SuSE-Code-11-Branch/gtk/src/YGUtils.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/gtk/src/YGUtils.cc?rev=55561&r1=55560&r2=55561&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/gtk/src/YGUtils.cc (original) +++ branches/SuSE-Code-11-Branch/gtk/src/YGUtils.cc Tue Feb 17 16:35:29 2009 @@ -246,8 +246,18 @@ i += strlen (entity->html); if (instr[i+1] == ';') i++; } - else - g_string_append_c (outp, instr[i]); + else { + int j; + // check it is a valid entity - not a floating '&' in a <pre> tag eg. + for (j = i + 1; instr[j] != '\0'; j++) { + if (!g_ascii_isalnum (instr[j]) && instr[j] != '#') + break; + } + if (instr[j] != ';') // entity terminator + g_string_append (outp, "&"); + else + g_string_append_c (outp, instr[i]); + } was_space = FALSE; } Modified: branches/SuSE-Code-11-Branch/gtk/src/test.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/gtk/src/test.cc?rev=55561&r1=55560&r2=55561&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/gtk/src/test.cc (original) +++ branches/SuSE-Code-11-Branch/gtk/src/test.cc Tue Feb 17 16:35:29 2009 @@ -41,6 +41,22 @@ #include "ygtkrichtext.h" +bool testParse(const char *xml) +{ + GError *error = NULL; + GMarkupParser parser = { 0, }; + GMarkupParseContext *ctx = g_markup_parse_context_new (&parser, GMarkupParseFlags (0), NULL, NULL); + + if (!g_markup_parse_context_parse (ctx, xml, -1, &error)) + { + fprintf (stderr, "Invalid XML: '%s'\n '%s'\n", xml, error->message); + return false; + } + g_markup_parse_context_free (ctx); + + return true; +} + bool testXHtmlConvert() { fprintf (stderr, "Test HTML->XML rewrite \t"); @@ -76,6 +92,12 @@ // comment { "we need <b>to <!-- really need to? --> do something</b> about it.", "<body>we need <b>to do something</b> about it.</body>" }, + { "&", "<body>&</body>" }, + { "&", "<body>&</body>" }, + { "& foo", "<body>& foo</body>" }, + { "& foo", "<body>& foo</body>" }, + { "<pre>https://foo.com/regsvc-1.0/?lang=de-DE&guid=1529f49dc701449fbd854aebf7e40806&command=interactive</pre>\n", + "<body><pre>https://foo.com/regsvc-1.0/?lang=de-DE&guid=1529f49dc701449fbd854aebf7e40806&command=interactive</pre> </body>" }, { NULL, NULL } }; for (int i = 0; aTests[i].in; i++) { @@ -85,6 +107,9 @@ i, out, aTests[i].out); return false; } + if (!testParse (out)) + return false; + fprintf (stderr, "%d ", i); g_free (out); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mkudlvasr@svn.opensuse.org