From 549bf8e8954efb47b3ea51c89b44f6f936ed3dbd Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Tue, 21 Jul 1998 01:55:52 +0000 Subject: [PATCH] Added use of flag in IL_GetImage to identify an Editor when loading images, and use of that flag in IL_ViewStream to do use IL_NewStream instead (fixes regresion bug) --- modules/libimg/src/external.c | 9 +++++++-- modules/libimg/src/if.c | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/libimg/src/external.c b/modules/libimg/src/external.c index 2d79be7a9d73..1d2526567ba6 100644 --- a/modules/libimg/src/external.c +++ b/modules/libimg/src/external.c @@ -119,13 +119,18 @@ IL_ViewStream(FO_Present_Types format_out, void *newshack, URL_Struct *urls, char *image_url; /* multi-part reconnect hack */ - ic = (il_container*)urls->fe_data; - if(ic && ic->multi) + + /* Extreme editor hack! This value is used when loading images + so we use the converter we did in 4.06 code. + If we don't, this code triggers parsing of the image URL, + which has very bad effects in the editor! */ + if((urls && urls->owner_id == 0x000000ED) || (ic && ic->multi)) { return IL_NewStream(format_out, IL_UNKNOWN, urls, cx); } + /* Create stream object */ if (!(stream = XP_NEW_ZAP(NET_StreamClass))) { XP_TRACE(("il: IL_ViewStream memory lossage")); diff --git a/modules/libimg/src/if.c b/modules/libimg/src/if.c index 73f631b090f3..fdd9a73c1dbb 100644 --- a/modules/libimg/src/if.c +++ b/modules/libimg/src/if.c @@ -1886,6 +1886,12 @@ IL_GetImage(const char* image_url, /* Add the referer to the URL. */ IL_AddReferer(ic->net_cx, urls); + + /* EXTREME HACK ALERT! + Special signal for Composer (Editor) + This will be used in IL_ViewStream to tell we are an editor + and use IL_NewStream instead (as we did in 4.06 code) */ + urls->owner_id = (int)flags; ic->is_looping = FALSE; ic->url = urls;