From bf2df107ef0328e247e0351250e6e566eb8dccf8 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Tue, 21 Jul 1998 23:36:03 +0000 Subject: [PATCH] Fixed problem with clearing is_new_document flag in edit buffer when reusing existing new-doc buffer git-svn-id: svn://10.0.0.236/trunk@6123 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/lib/layout/edtbuf.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mozilla/lib/layout/edtbuf.cpp b/mozilla/lib/layout/edtbuf.cpp index 2180b89caec..49775be6577 100644 --- a/mozilla/lib/layout/edtbuf.cpp +++ b/mozilla/lib/layout/edtbuf.cpp @@ -10082,6 +10082,17 @@ void CEditBuffer::FinishedLoad2() XP_Bool bShouldSendOpenEvent = !GetCommandLog()->InReload(); + // Be sure a doc that thinks its "new" has the correct URL + // If user loads a URL into a "new doc" buffer that is unedited, + // we reuse that buffer and context, so we must clear the new-doc flag here + // (this used to be done in NET_GetURL, mkgeturl.c, but that had bad side effects) + char *pBaseURL = LO_GetBaseURL(m_pContext); + if( pBaseURL && EDT_IS_NEW_DOCUMENT(m_pContext) && + 0 != XP_STRCMP(pBaseURL, XP_GetString(XP_EDIT_NEW_DOC_NAME)) ) + { + m_pContext->is_new_document = FALSE; + } + // Set page properties (color, background, etc.) // for a new document: XP_Bool bIsNewDocument = EDT_IS_NEW_DOCUMENT(m_pContext)