fixed bugs 10104 and 10107 -- also removed warnings
git-svn-id: svn://10.0.0.236/trunk@40247 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -370,7 +370,7 @@ void CNavDTD::RecycleNode(nsCParserNode* aNode) {
|
||||
if(aNode) {
|
||||
|
||||
CToken* theToken=0;
|
||||
while(theToken=((CToken*)aNode->PopAttributeToken())){
|
||||
while((theToken=(CToken*)aNode->PopAttributeToken())){
|
||||
gRecycler->RecycleToken(theToken);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ CNavDTD::~CNavDTD(){
|
||||
if(mTokenizer)
|
||||
delete (nsHTMLTokenizer*)mTokenizer;
|
||||
nsCParserNode* theNode=0;
|
||||
while(theNode=((nsCParserNode*)mSharedNodes.Pop())){
|
||||
while((theNode=(nsCParserNode*)mSharedNodes.Pop())){
|
||||
delete theNode;
|
||||
}
|
||||
NS_IF_RELEASE(mDTDDebug);
|
||||
|
||||
@@ -111,9 +111,7 @@ static RTFEntry gRTFTable[] = {
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
#if 0
|
||||
static
|
||||
const char* GetTagName(eRTFTags aTag) {
|
||||
static const char* GetTagName(eRTFTags aTag) {
|
||||
PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry);
|
||||
PRInt32 low=0;
|
||||
PRInt32 high=cnt-1;
|
||||
@@ -129,7 +127,7 @@ const char* GetTagName(eRTFTags aTag) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* This method gets called as part of our COM-like interfaces.
|
||||
|
||||
@@ -982,7 +982,7 @@ nsHTMLElement gHTMLElements[] = {
|
||||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,
|
||||
/*parent,incl,exclgroups*/ kSpecial, (kSelf|SPECIALTYPE), kNone,
|
||||
/*parent,incl,exclgroups*/ kBlock, (kInlineEntity|kSelf|kFlowEntity), kNone,
|
||||
/*special props, prop-range*/ 0,kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown},
|
||||
|
||||
|
||||
@@ -149,6 +149,18 @@ nsHTMLEntities::EntityToUnicode(const nsStr& aEntity)
|
||||
{
|
||||
NS_ASSERTION(gEntityToCodeTree, "no lookup table, needs addref");
|
||||
if (gEntityToCodeTree) {
|
||||
|
||||
//this little piece of code exists because entities may or may not have the terminating ';'.
|
||||
//if we see it, strip if off for this test...
|
||||
|
||||
PRUnichar theLastChar=GetCharAt(aEntity,aEntity.mLength-1);
|
||||
if(';'==theLastChar) {
|
||||
nsCAutoString temp(aEntity);
|
||||
temp.Truncate(aEntity.mLength-1);
|
||||
return EntityToUnicode(temp);
|
||||
}
|
||||
|
||||
|
||||
EntityNode node(aEntity);
|
||||
EntityNode* found = (EntityNode*)gEntityToCodeTree->FindItem(&node);
|
||||
if (found) {
|
||||
|
||||
@@ -551,7 +551,6 @@ nsresult nsHTMLTokenizer::ConsumeEntity(PRUnichar aChar,CToken*& aToken,nsScanne
|
||||
//convert it into a text token.
|
||||
nsAutoString temp("&");
|
||||
temp.Append(theStr);
|
||||
temp.Append(';');
|
||||
CToken* theToken=theRecycler->CreateTokenOfType(eToken_text,eHTMLTag_text,temp);
|
||||
theRecycler->RecycleToken(aToken);
|
||||
aToken=theToken;
|
||||
|
||||
@@ -1445,6 +1445,7 @@ PRInt32 CEntityToken::ConsumeEntity(PRUnichar aChar,nsString& aString,nsScanner&
|
||||
if(NS_OK==result) {
|
||||
if (kSemicolon == theChar) {
|
||||
// consume semicolon that stopped the scan
|
||||
aString+=theChar;
|
||||
result=aScanner.GetChar(theChar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,7 +887,7 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD, PRBool aIsFinalChunk) {
|
||||
// If we're told to block the parser, we disable
|
||||
// all further parsing (and cache any data coming
|
||||
// in) until the parser is enabled.
|
||||
PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK;
|
||||
//PRUint32 b1=NS_ERROR_HTMLPARSER_BLOCK;
|
||||
if(NS_ERROR_HTMLPARSER_BLOCK==result) {
|
||||
EnableParser(PR_FALSE);
|
||||
result=NS_OK;
|
||||
|
||||
@@ -55,7 +55,7 @@ nsCParserNode::nsCParserNode(CToken* aToken,PRInt32 aLineNumber,nsITokenRecycler
|
||||
static void RecycleTokens(nsITokenRecycler* aRecycler,nsDeque& aDeque) {
|
||||
CToken* theToken=0;
|
||||
if(aRecycler) {
|
||||
while(theToken=((CToken*)aDeque.Pop())){
|
||||
while((theToken=(CToken*)aDeque.Pop())){
|
||||
aRecycler->RecycleToken(theToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ static void SetFont(const char* aFace,const char* aSize,PRBool aEnable,nsIConten
|
||||
aSink.CloseContainer(theNode);
|
||||
}
|
||||
|
||||
while(theToken=((CToken*)theNode.PopAttributeToken())){
|
||||
while((theToken=(CToken*)theNode.PopAttributeToken())){
|
||||
//dump the attributes since they're on the stack...
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ static void SetColor(const char* aColor,PRBool aEnable,nsIContentSink& aSink) {
|
||||
aSink.CloseContainer(theNode);
|
||||
}
|
||||
|
||||
while(theToken=((CToken*)theNode.PopAttributeToken())){
|
||||
while((theToken=(CToken*)theNode.PopAttributeToken())){
|
||||
//dump the attributes since they're on the stack...
|
||||
}
|
||||
|
||||
@@ -866,7 +866,7 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
|
||||
}
|
||||
}
|
||||
theStr.Append(aToken->GetStringValueXXX());
|
||||
theStr.Append(";");
|
||||
//theStr.Append(";");
|
||||
::WriteText(theStr,*mSink,PR_FALSE,mIsPlaintext,theContext);
|
||||
if(!mIsPlaintext){
|
||||
SetStyle(eHTMLTag_font,PR_FALSE,*mSink);
|
||||
|
||||
Reference in New Issue
Block a user