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

git-svn-id: svn://10.0.0.236/trunk@6801 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hardts%netscape.com 1998-07-29 22:42:44 +00:00
parent 4672676a7f
commit 1dc2e6d9d6
4 changed files with 33 additions and 13 deletions

View File

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

View File

@ -102,6 +102,10 @@ public:
virtual void SetBackgroundLoad(PRBool aBgload);
virtual int GetOwnerId();
virtual void SetOwnerId(int aOwnerId);
URL_Struct *GetURLStruct() { return mURLS; }
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;
}
}

View File

@ -216,15 +216,11 @@ IL_ViewStream(FO_Present_Types format_out, void *newshack, URL_Struct *urls,
reader = iurl->GetReader();
if(reader)
{
#if 0
/* This change is not fully merged from the MODULAR_IMGLIB_BRANCH landing. */
/* 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))
#endif
if(reader->IsMulti()) {
/* 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((iurl->GetOwnerId() == 0x000000ED) || reader->IsMulti()) {
NS_RELEASE(reader);
return IL_NewStream(format_out, IL_UNKNOWN, urls, cx);
}

View File

@ -1874,14 +1874,11 @@ IL_GetImage(const char* image_url,
ic->net_cx->AddReferer(url);
#endif
#if 0
/* This change is not fully merged from the MODULAR_IMGLIB_BRANCH landing. */
/* 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;
#endif
url->SetOwnerId((int)flags);
ic->is_looping = FALSE;
ic->url = url;