From 8578e529d9b92a014d39bd009a064ee090268348 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Wed, 7 Oct 1998 23:01:26 +0000 Subject: [PATCH] Trying to fix automated test breakage --- lib/layout/edtutil.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/layout/edtutil.cpp b/lib/layout/edtutil.cpp index dd8a9a6edb5b..777b2c961870 100644 --- a/lib/layout/edtutil.cpp +++ b/lib/layout/edtutil.cpp @@ -5805,6 +5805,9 @@ EDT_GetEditHistory(MWContext * pMWContext, unsigned n, if( !ppEditHistoryURLs ) EDT_SyncEditHistory(pMWContext); + if( !ppEditHistoryURLs ) + return FALSE; + // Check if current URL is matches the requested or more recent items in the list if( pMWContext ) { @@ -5856,6 +5859,18 @@ EDT_SyncEditHistory(MWContext * pMWContext) if(!pMWContext) return; + // We are not in a happy state if there's no history item + History_entry * pEntry = SHIST_GetCurrent(&(pMWContext->hist)); + if(!pEntry || !pEntry->address || !*pEntry->address ) + return; + + // Test for new document URL: file://Untitled and ignore it + if( !XP_STRCMP(XP_GetString(XP_EDIT_NEW_DOC_NAME), pEntry->address) || + !XP_STRCMP(XP_GetString(XP_EDIT_NEW_DOC_URL), pEntry->address)) + { + return; + } + // Initialize the local arrays from the current preference list if( !ppEditHistoryURLs ) { @@ -5896,20 +5911,10 @@ EDT_SyncEditHistory(MWContext * pMWContext) } } } - - History_entry * pEntry = SHIST_GetCurrent(&(pMWContext->hist)); - - // Must have an address - if( !pEntry || !pEntry->address || !*pEntry->address ) + // We failed to initialize - quit + if( !ppEditHistoryURLs ) return; - // Test for new document URL: file://Untitled and ignore it - if( !XP_STRCMP(XP_GetString(XP_EDIT_NEW_DOC_NAME), pEntry->address) || - !XP_STRCMP(XP_GetString(XP_EDIT_NEW_DOC_URL), pEntry->address)) - { - return; - } - if( pEntry->title && *pEntry->title ){ pTitle = pEntry->title; }