aboutsummaryrefslogtreecommitdiff
path: root/src/web.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/web.cc')
-rw-r--r--src/web.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/web.cc b/src/web.cc
index 48c368be..fcc65af8 100644
--- a/src/web.cc
+++ b/src/web.cc
@@ -55,9 +55,12 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
dReturn_val_if_fail(Web->bw != NULL, -1);
- // get the Layout object from the bw structure.
Layout *layout = (Layout*)Web->bw->render_layout;
+ Viewer_t viewer = a_Mime_get_viewer(Type);
+ if (viewer == NULL)
+ return -1;
+
if (Web->flags & WEB_RootUrl) {
/* We have RootUrl! */
@@ -69,7 +72,7 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
StyleEngine styleEngine (layout);
styleEngine.startElement ("body");
- dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data);
+ dw = (Widget*) viewer(Type, Web, Call, Data);
if (dw == NULL)
return -1;
@@ -96,7 +99,7 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
} else {
/* A non-RootUrl. At this moment we only handle image-children */
if (!dStrnAsciiCasecmp(Type, "image/", 6)) {
- dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data);
+ dw = (Widget*) viewer(Type, Web, Call, Data);
} else {
MSG_HTTP("'%s' cannot be displayed as image; has media type '%s'\n",
URL_STR(Web->url), Type);