From aa418dc7e366e5a409cc029966c69ae53d792cfa Mon Sep 17 00:00:00 2001 From: "harishd%netscape.com" Date: Tue, 27 Jul 1999 23:32:30 +0000 Subject: [PATCH] Made EnableParse() to return nsresult. Used to return PRBool git-svn-id: svn://10.0.0.236/trunk@41356 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsIParser.h | 2 +- mozilla/htmlparser/src/nsParser.cpp | 7 +++---- mozilla/htmlparser/src/nsParser.h | 2 +- mozilla/parser/htmlparser/src/nsIParser.h | 2 +- mozilla/parser/htmlparser/src/nsParser.cpp | 7 +++---- mozilla/parser/htmlparser/src/nsParser.h | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/mozilla/htmlparser/src/nsIParser.h b/mozilla/htmlparser/src/nsIParser.h index e9797f6a4b7..485c590e7ed 100644 --- a/mozilla/htmlparser/src/nsIParser.h +++ b/mozilla/htmlparser/src/nsIParser.h @@ -165,7 +165,7 @@ CLASS_EXPORT_HTMLPARS nsIParser : public nsISupports { * until you wind up being emitted to the given contentsink (which may or may not * be a proxy for the NGLayout content model). ******************************************************************************************/ - virtual PRBool EnableParser(PRBool aState) = 0; + virtual nsresult EnableParser(PRBool aState) = 0; virtual PRBool IsParserEnabled() = 0; virtual nsresult Parse(nsIURI* aURL,nsIStreamObserver* aListener = nsnull,PRBool aEnableVerify=PR_FALSE, void* aKey=0,eParseMode aMode=eParseMode_autodetect) = 0; virtual nsresult Parse(nsIInputStream& aStream, PRBool aEnableVerify=PR_FALSE, void* aKey=0,eParseMode aMode=eParseMode_autodetect) = 0; diff --git a/mozilla/htmlparser/src/nsParser.cpp b/mozilla/htmlparser/src/nsParser.cpp index e272ee44d33..0339282c0cf 100644 --- a/mozilla/htmlparser/src/nsParser.cpp +++ b/mozilla/htmlparser/src/nsParser.cpp @@ -600,7 +600,7 @@ nsresult nsParser::Terminate(void){ * @param aState determines whether we parse/tokenize or just cache. * @return current state */ -PRBool nsParser::EnableParser(PRBool aState){ +nsresult nsParser::EnableParser(PRBool aState){ nsIParser* me = nsnull; // If the stream has already finished, there's a good chance @@ -624,7 +624,7 @@ PRBool nsParser::EnableParser(PRBool aState){ // Release reference if we added one at the top of this routine NS_IF_RELEASE(me); - return aState; + return result; } /** @@ -899,8 +899,7 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD, PRBool aIsFinalChunk) { // in) until the parser is enabled. //PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK; if(NS_ERROR_HTMLPARSER_BLOCK==result) { - EnableParser(PR_FALSE); - result=NS_OK; + result=EnableParser(PR_FALSE); } }//if }//if diff --git a/mozilla/htmlparser/src/nsParser.h b/mozilla/htmlparser/src/nsParser.h index 98ca88e9a02..f82e03af768 100644 --- a/mozilla/htmlparser/src/nsParser.h +++ b/mozilla/htmlparser/src/nsParser.h @@ -205,7 +205,7 @@ friend class CTokenHandler; * @param aState determines whether we parse/tokenize or just cache. * @return current state */ - virtual PRBool EnableParser(PRBool aState); + virtual nsresult EnableParser(PRBool aState); virtual nsresult Terminate(void); /** diff --git a/mozilla/parser/htmlparser/src/nsIParser.h b/mozilla/parser/htmlparser/src/nsIParser.h index e9797f6a4b7..485c590e7ed 100644 --- a/mozilla/parser/htmlparser/src/nsIParser.h +++ b/mozilla/parser/htmlparser/src/nsIParser.h @@ -165,7 +165,7 @@ CLASS_EXPORT_HTMLPARS nsIParser : public nsISupports { * until you wind up being emitted to the given contentsink (which may or may not * be a proxy for the NGLayout content model). ******************************************************************************************/ - virtual PRBool EnableParser(PRBool aState) = 0; + virtual nsresult EnableParser(PRBool aState) = 0; virtual PRBool IsParserEnabled() = 0; virtual nsresult Parse(nsIURI* aURL,nsIStreamObserver* aListener = nsnull,PRBool aEnableVerify=PR_FALSE, void* aKey=0,eParseMode aMode=eParseMode_autodetect) = 0; virtual nsresult Parse(nsIInputStream& aStream, PRBool aEnableVerify=PR_FALSE, void* aKey=0,eParseMode aMode=eParseMode_autodetect) = 0; diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index e272ee44d33..0339282c0cf 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -600,7 +600,7 @@ nsresult nsParser::Terminate(void){ * @param aState determines whether we parse/tokenize or just cache. * @return current state */ -PRBool nsParser::EnableParser(PRBool aState){ +nsresult nsParser::EnableParser(PRBool aState){ nsIParser* me = nsnull; // If the stream has already finished, there's a good chance @@ -624,7 +624,7 @@ PRBool nsParser::EnableParser(PRBool aState){ // Release reference if we added one at the top of this routine NS_IF_RELEASE(me); - return aState; + return result; } /** @@ -899,8 +899,7 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD, PRBool aIsFinalChunk) { // in) until the parser is enabled. //PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK; if(NS_ERROR_HTMLPARSER_BLOCK==result) { - EnableParser(PR_FALSE); - result=NS_OK; + result=EnableParser(PR_FALSE); } }//if }//if diff --git a/mozilla/parser/htmlparser/src/nsParser.h b/mozilla/parser/htmlparser/src/nsParser.h index 98ca88e9a02..f82e03af768 100644 --- a/mozilla/parser/htmlparser/src/nsParser.h +++ b/mozilla/parser/htmlparser/src/nsParser.h @@ -205,7 +205,7 @@ friend class CTokenHandler; * @param aState determines whether we parse/tokenize or just cache. * @return current state */ - virtual PRBool EnableParser(PRBool aState); + virtual nsresult EnableParser(PRBool aState); virtual nsresult Terminate(void); /**