Reenable Charlie's editor hack to deal with IL_ViewStream/IL_NewStream problems

This commit is contained in:
hardts%netscape.com 1998-07-29 22:42:44 +00:00
Родитель 028eed743b
Коммит 638b2a5976
4 изменённых файлов: 33 добавлений и 13 удалений

Просмотреть файл

@ -42,6 +42,9 @@ public:
virtual void SetBackgroundLoad(PRBool aBgload)=0; virtual void SetBackgroundLoad(PRBool aBgload)=0;
virtual int GetOwnerId()=0;
virtual void SetOwnerId(int)=0;
}; };
#endif #endif

Просмотреть файл

@ -102,6 +102,10 @@ public:
virtual void SetBackgroundLoad(PRBool aBgload); virtual void SetBackgroundLoad(PRBool aBgload);
virtual int GetOwnerId();
virtual void SetOwnerId(int aOwnerId);
URL_Struct *GetURLStruct() { return mURLS; } URL_Struct *GetURLStruct() { return mURLS; }
private: private:
@ -518,4 +522,24 @@ URLImpl::SetBackgroundLoad(PRBool bgload)
} }
} }
int
URLImpl::GetOwnerId()
{
if (mURLS) {
return mURLS->owner_id;
}
else {
return 0;
}
}
void
URLImpl::SetOwnerId(int ownerId)
{
if (mURLS) {
mURLS->owner_id = ownerId;
}
}

Просмотреть файл

@ -216,15 +216,11 @@ IL_ViewStream(FO_Present_Types format_out, void *newshack, URL_Struct *urls,
reader = iurl->GetReader(); reader = iurl->GetReader();
if(reader) if(reader)
{ {
#if 0 /* Extreme editor hack! This value is used when loading images
/* This change is not fully merged from the MODULAR_IMGLIB_BRANCH landing. */ so we use the converter we did in 4.06 code.
/* Extreme editor hack! This value is used when loading images If we don't, this code triggers parsing of the image URL,
so we use the converter we did in 4.06 code. which has very bad effects in the editor! */
If we don't, this code triggers parsing of the image URL, if((iurl->GetOwnerId() == 0x000000ED) || reader->IsMulti()) {
which has very bad effects in the editor! */
if((urls && urls->owner_id == 0x000000ED) || (ic && ic->multi))
#endif
if(reader->IsMulti()) {
NS_RELEASE(reader); NS_RELEASE(reader);
return IL_NewStream(format_out, IL_UNKNOWN, urls, cx); return IL_NewStream(format_out, IL_UNKNOWN, urls, cx);
} }

Просмотреть файл

@ -1874,14 +1874,11 @@ IL_GetImage(const char* image_url,
ic->net_cx->AddReferer(url); ic->net_cx->AddReferer(url);
#endif #endif
#if 0
/* This change is not fully merged from the MODULAR_IMGLIB_BRANCH landing. */
/* EXTREME HACK ALERT! /* EXTREME HACK ALERT!
Special signal for Composer (Editor) Special signal for Composer (Editor)
This will be used in IL_ViewStream to tell we are an 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) */ and use IL_NewStream instead (as we did in 4.06 code) */
urls->owner_id = (int)flags; url->SetOwnerId((int)flags);
#endif
ic->is_looping = FALSE; ic->is_looping = FALSE;
ic->url = url; ic->url = url;