From 60ebe8f604c69af473c09141d602397b9401739c Mon Sep 17 00:00:00 2001 From: Ali Abdin Date: Fri, 27 Oct 2000 11:28:33 +0000 Subject: Added a 'base_path' to the Context struct (parse_file): Do some minimal 2000-10-27 Ali Abdin * components/help/converters/gnome-db2html2/gdb3html.[ch]: Added a 'base_path' to the Context struct (parse_file): Do some minimal parsing to get the base path from the provided filename on the command line. * components/help/converters/gnome-db2html2/sect-elements.c: * components/help/converters/gnome-db2html2/toc-elements.c: (sect_figure_end_element), (sect_inlinegraphic_start_element), (sect_infobox_start_element), (toc_artheader_end_element): Use 'file://' URIs on images (using base_path to get the path of the image). This means images should now work within SGML files. Should fix bug #3938 --- components/help/converters/gnome-db2html2/sect-elements.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'components/help/converters/gnome-db2html2/sect-elements.c') diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c index d8809510b..5c3948bef 100644 --- a/components/help/converters/gnome-db2html2/sect-elements.c +++ b/components/help/converters/gnome-db2html2/sect-elements.c @@ -1030,7 +1030,8 @@ sect_figure_end_element (Context *context, if (sect_context->figure->id) sect_print (context, ""); sect_print (context, "

"); - sect_print (context, "\"%s\"

", + sect_print (context, "\"%s\"

", + context->base_path, sect_context->figure->img, (sect_context->figure->alt) ? sect_context->figure->alt : "IMAGE"); } @@ -1080,19 +1081,19 @@ sect_inlinegraphic_start_element (Context *context, /* FIXME: Should we put an 'ALT' tag here? */ if (format == NULL) { /* Default is PNG */ - sect_print (context, "", fileref); + sect_print (context, "", context->base_path, fileref); } else if (g_strcasecmp (format, "gif") == 0) { - sect_print (context, "", fileref); + sect_print (context, "", context->base_path, fileref); } else if ((g_strcasecmp (format, "jpg") == 0) || (g_strcasecmp (format, "jpeg") == 0)) { /* Some people decide to use .jpg, others use .jpeg */ lowcaseformat = g_strdup (format); g_strdown (lowcaseformat); - sect_print (context, "", fileref, lowcaseformat); + sect_print (context, "", context->base_path, fileref, lowcaseformat); g_free (lowcaseformat); } else { /* Unknown file format */ - sect_print (context, "", fileref, format); + sect_print (context, "", context->base_path, fileref, format); } } @@ -1468,7 +1469,7 @@ sect_infobox_start_element (Context *context, sect_print (context, "\n
"); if (logo != NULL) - sect_print (context, "\"%s\"", name, logo); + sect_print (context, "\"%s\"", name, logo); else sect_print (context, "%s", name); sect_print (context, "\n"); -- cgit v1.2.1