warning removal
This commit is contained in:
@@ -130,7 +130,6 @@ nsBTree::~nsBTree(){
|
|||||||
* @return ptr to added node or NULL
|
* @return ptr to added node or NULL
|
||||||
*/
|
*/
|
||||||
nsNode* nsBTree::Add(nsNode& aNode){
|
nsNode* nsBTree::Add(nsNode& aNode){
|
||||||
PRBool result=PR_TRUE;
|
|
||||||
|
|
||||||
nsNode* node1=mRoot; //x
|
nsNode* node1=mRoot; //x
|
||||||
nsNode* node2=0; //y
|
nsNode* node2=0; //y
|
||||||
@@ -225,7 +224,7 @@ nsBTree& nsBTree::Empty(nsNode* aNode) {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
nsBTree& nsBTree::Erase(nsNode* aNode){
|
nsBTree& nsBTree::Erase(nsNode* aNode){
|
||||||
nsNode* node1 =(aNode) ? aNode : mRoot;
|
// nsNode* node1 =(aNode) ? aNode : mRoot;
|
||||||
|
|
||||||
if(aNode) {
|
if(aNode) {
|
||||||
Erase(aNode->mLeft); //begin by walking left side
|
Erase(aNode->mLeft); //begin by walking left side
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
friend class nsBTreeIterator;
|
friend class nsBTreeIterator;
|
||||||
|
|
||||||
nsBTree();
|
nsBTree();
|
||||||
~nsBTree();
|
virtual ~nsBTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add given node reference into our tree.
|
* Add given node reference into our tree.
|
||||||
|
|||||||
@@ -245,8 +245,7 @@ const void* nsDeque::ForEach(nsDequeFunctor& aFunctor) const{
|
|||||||
* @param aQueue is the deque object to be iterated
|
* @param aQueue is the deque object to be iterated
|
||||||
* @param anIndex is the starting position for your iteration
|
* @param anIndex is the starting position for your iteration
|
||||||
*/
|
*/
|
||||||
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQueue) {
|
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) {
|
||||||
mIndex=anIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -256,9 +255,7 @@ nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQue
|
|||||||
* @param aCopy is another iterator to copy from
|
* @param aCopy is another iterator to copy from
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) :
|
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) {
|
||||||
mDeque(aCopy.mDeque),
|
|
||||||
mIndex(aCopy.mIndex) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ friend class NS_BASE nsRBTreeIterator;
|
|||||||
*
|
*
|
||||||
* @update gess 4/11/98
|
* @update gess 4/11/98
|
||||||
*/
|
*/
|
||||||
~nsRBTree();
|
virtual ~nsRBTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a node, we're supposed to add it into
|
* Given a node, we're supposed to add it into
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const
|
|||||||
float nsString::ToFloat(PRInt32* aErrorCode) const
|
float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
if (mLength > sizeof(buf)-1) {
|
if (mLength > PRInt32(sizeof(buf)-1)) {
|
||||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -995,8 +993,6 @@ PRInt32 nsString::Insert(PRUnichar aChar,PRInt32 anOffset){
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -1280,7 +1276,6 @@ PRInt32 nsString::Find(const nsString& aString) const{
|
|||||||
* @return offset of found char, or -1 (kNotFound)
|
* @return offset of found char, or -1 (kNotFound)
|
||||||
*------------------------------------------------------*/
|
*------------------------------------------------------*/
|
||||||
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
||||||
PRInt32 result=0;
|
|
||||||
|
|
||||||
for(PRInt32 i=anOffset;i<mLength;i++)
|
for(PRInt32 i=anOffset;i<mLength;i++)
|
||||||
if(aChar==mStr[i])
|
if(aChar==mStr[i])
|
||||||
@@ -2071,7 +2066,7 @@ NS_BASE int fputs(const nsString& aString, FILE* out)
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
char* cp = buf;
|
char* cp = buf;
|
||||||
PRInt32 len = aString.Length();
|
PRInt32 len = aString.Length();
|
||||||
if (len >= sizeof(buf)) {
|
if (len >= PRInt32(sizeof(buf))) {
|
||||||
cp = aString.ToNewCString();
|
cp = aString.ToNewCString();
|
||||||
} else {
|
} else {
|
||||||
aString.ToCString(cp, len + 1);
|
aString.ToCString(cp, len + 1);
|
||||||
|
|||||||
@@ -43,9 +43,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||||||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||||
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
|
||||||
static const char* kNullToken = "Error: Null token given";
|
static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kHTMLTextContentType = "text/html";
|
static const char* kHTMLTextContentType = "text/html";
|
||||||
@@ -335,8 +334,7 @@ static CNavTokenDeallocator gTokenKiller;
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CNavDTD::CNavDTD() : nsIDTD(), mTokenDeque(gTokenKiller),
|
CNavDTD::CNavDTD() : nsIDTD(), mContextStack(), mStyleStack(), mTokenDeque(gTokenKiller) {
|
||||||
mContextStack(), mStyleStack() {
|
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
mParser=0;
|
mParser=0;
|
||||||
mSink = nsnull;
|
mSink = nsnull;
|
||||||
@@ -423,12 +421,12 @@ eAutoDetectResult CNavDTD::AutoDetectContentType(nsString& aBuffer,nsString& aTy
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
mFilename=aFilename;
|
mFilename=aFilename;
|
||||||
|
|
||||||
if((1==aLevel) && (mSink)) {
|
if((aNotifySink) && (mSink)) {
|
||||||
mLineNumber=1;
|
mLineNumber=1;
|
||||||
result = mSink->WillBuildModel();
|
result = mSink->WillBuildModel();
|
||||||
}
|
}
|
||||||
@@ -442,14 +440,14 @@ nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result= NS_OK;
|
nsresult result= NS_OK;
|
||||||
|
|
||||||
if((kNoError==anErrorCode) && (mContextStack.mCount>0)) {
|
if((kNoError==anErrorCode) && (mContextStack.mCount>0)) {
|
||||||
result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
|
result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((1==aLevel) && (mSink)) {
|
if((aNotifySink) && (mSink)) {
|
||||||
result = mSink->DidBuildModel(1);
|
result = mSink->DidBuildModel(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -818,9 +816,7 @@ nsresult CNavDTD::HandleAttributeToken(CToken* aToken) {
|
|||||||
NS_PRECONDITION(0!=aToken,kNullToken);
|
NS_PRECONDITION(0!=aToken,kNullToken);
|
||||||
NS_ERROR("attribute encountered -- this shouldn't happen!");
|
NS_ERROR("attribute encountered -- this shouldn't happen!");
|
||||||
|
|
||||||
CAttributeToken* at = (CAttributeToken*)(aToken);
|
return NS_OK;
|
||||||
nsresult result=NS_OK;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -872,9 +868,8 @@ nsresult CNavDTD::HandleScriptToken(CToken* aToken, nsCParserNode& aNode) {
|
|||||||
nsresult CNavDTD::HandleStyleToken(CToken* aToken){
|
nsresult CNavDTD::HandleStyleToken(CToken* aToken){
|
||||||
NS_PRECONDITION(0!=aToken,kNullToken);
|
NS_PRECONDITION(0!=aToken,kNullToken);
|
||||||
|
|
||||||
CStyleToken* st = (CStyleToken*)(aToken);
|
// CStyleToken* st = (CStyleToken*)(aToken);
|
||||||
nsresult result=NS_OK;
|
return NS_OK;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -924,7 +919,6 @@ CITokenHandler* CNavDTD::AddTokenHandler(CITokenHandler* aHandler) {
|
|||||||
if(aHandler) {
|
if(aHandler) {
|
||||||
eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType();
|
eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType();
|
||||||
if(type<eToken_last) {
|
if(type<eToken_last) {
|
||||||
CITokenHandler* old=mTokenHandlers[type];
|
|
||||||
mTokenHandlers[type]=aHandler;
|
mTokenHandlers[type]=aHandler;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1739,7 +1733,6 @@ PRBool CNavDTD::ForwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTag
|
|||||||
*/
|
*/
|
||||||
PRBool CNavDTD::BackwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTags aChildTag) const {
|
PRBool CNavDTD::BackwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTags aChildTag) const {
|
||||||
|
|
||||||
PRBool result=PR_FALSE;
|
|
||||||
eHTMLTags theParentTag=(eHTMLTags)aChildTag;
|
eHTMLTags theParentTag=(eHTMLTags)aChildTag;
|
||||||
|
|
||||||
// aVector.Truncate();
|
// aVector.Truncate();
|
||||||
@@ -2199,9 +2192,6 @@ CNavDTD::OpenContainer(const nsIParserNode& aNode,PRBool aUpdateStyleStack){
|
|||||||
|
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
eHTMLTags nodeType=(eHTMLTags)aNode.GetNodeType();
|
eHTMLTags nodeType=(eHTMLTags)aNode.GetNodeType();
|
||||||
PRInt32 num=aNode.GetSourceLineNumber();
|
|
||||||
|
|
||||||
// CloseTransientStyles(nodeType);
|
|
||||||
|
|
||||||
switch(nodeType) {
|
switch(nodeType) {
|
||||||
|
|
||||||
@@ -2880,7 +2870,8 @@ nsresult CNavDTD::ConsumeComment(PRUnichar aChar,CScanner& aScanner,CToken*& aTo
|
|||||||
*/
|
*/
|
||||||
nsresult CNavDTD::ConsumeText(const nsString& aString,CScanner& aScanner,CToken*& aToken){
|
nsresult CNavDTD::ConsumeText(const nsString& aString,CScanner& aScanner,CToken*& aToken){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
if(aToken=new CTextToken(aString)) {
|
aToken=new CTextToken(aString);
|
||||||
|
if(aToken) {
|
||||||
PRUnichar ch=0;
|
PRUnichar ch=0;
|
||||||
result=aToken->Consume(ch,aScanner);
|
result=aToken->Consume(ch,aScanner);
|
||||||
if(result) {
|
if(result) {
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -231,7 +231,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by the parser, once for each token
|
* This method is called by the parser, once for each token
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID);
|
||||||
static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID);
|
static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID);
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kHTMLTextContentType = "text/html";
|
//static const char* kHTMLTextContentType = "text/html";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -189,8 +189,8 @@ eAutoDetectResult COtherDTD::AutoDetectContentType(nsString& aBuffer,nsString& a
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) {
|
NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink) {
|
||||||
return CNavDTD::WillBuildModel(aFilename, aLevel);
|
return CNavDTD::WillBuildModel(aFilename, aNotifySink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,8 +199,8 @@ NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
return CNavDTD::DidBuildModel(anErrorCode, aLevel);
|
return CNavDTD::DidBuildModel(anErrorCode, aNotifySink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class COtherDTD : public CNavDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -107,7 +107,7 @@ class COtherDTD : public CNavDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
|
||||||
static const char* kNullToken = "Error: Null token given";
|
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
|
||||||
static const char* kRTFTextContentType = "application/rtf";
|
static const char* kRTFTextContentType = "application/rtf";
|
||||||
static const char* kRTFDocHeader= "{\\rtf0";
|
static const char* kRTFDocHeader= "{\\rtf0";
|
||||||
static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
@@ -119,7 +114,6 @@ static RTFEntry gRTFTable[] = {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
const char* GetTagName(eRTFTags aTag) {
|
const char* GetTagName(eRTFTags aTag) {
|
||||||
const char* result=0;
|
|
||||||
PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry);
|
PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry);
|
||||||
PRInt32 low=0;
|
PRInt32 low=0;
|
||||||
PRInt32 high=cnt-1;
|
PRInt32 high=cnt-1;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class CDTDDebug : public nsIDTDDebug {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
CDTDDebug(char * aVerifyDir = 0);
|
CDTDDebug(char * aVerifyDir = 0);
|
||||||
~CDTDDebug();
|
virtual ~CDTDDebug();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode, ostream& a
|
|||||||
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream)
|
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream)
|
||||||
{
|
{
|
||||||
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
||||||
const nsString& name = aNode.GetText();
|
// const nsString& name = aNode.GetText();
|
||||||
nsString tagName;
|
nsString tagName;
|
||||||
|
|
||||||
if (tag == eHTMLTag_unknown)
|
if (tag == eHTMLTag_unknown)
|
||||||
@@ -743,7 +743,7 @@ NS_IMETHODIMP
|
|||||||
nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){
|
nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){
|
||||||
if(mOutput) {
|
if(mOutput) {
|
||||||
AddStartTag(aNode,*mOutput);
|
AddStartTag(aNode,*mOutput);
|
||||||
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
// eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -886,6 +886,10 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const
|
|||||||
|
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -929,6 +933,10 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_style:
|
case eHTMLTag_style:
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -951,6 +959,10 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_style:
|
case eHTMLTag_style:
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -984,13 +996,6 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const {
|
|||||||
|
|
||||||
switch (aTag)
|
switch (aTag)
|
||||||
{
|
{
|
||||||
case eHTMLTag_html:
|
|
||||||
case eHTMLTag_pre:
|
|
||||||
case eHTMLTag_body:
|
|
||||||
case eHTMLTag_style:
|
|
||||||
result = PR_FALSE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case eHTMLTag_table:
|
case eHTMLTag_table:
|
||||||
case eHTMLTag_ul:
|
case eHTMLTag_ul:
|
||||||
case eHTMLTag_ol:
|
case eHTMLTag_ol:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
|||||||
class nsHTMLNullSink : public nsIHTMLContentSink {
|
class nsHTMLNullSink : public nsIHTMLContentSink {
|
||||||
public:
|
public:
|
||||||
nsHTMLNullSink();
|
nsHTMLNullSink();
|
||||||
~nsHTMLNullSink();
|
virtual ~nsHTMLNullSink();
|
||||||
|
|
||||||
enum eSection {eNone=0,eHTML,eHead,eBody,eContainer};
|
enum eSection {eNone=0,eHTML,eHead,eBody,eContainer};
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class nsIDTD : public nsISupports {
|
|||||||
* @param aFilename--string that contains name of file being parsed (if applicable)
|
* @param aFilename--string that contains name of file being parsed (if applicable)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel)=0;
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink)=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the parser after the parsing process has concluded
|
* Called by the parser after the parsing process has concluded
|
||||||
@@ -118,7 +118,7 @@ class nsIDTD : public nsISupports {
|
|||||||
* @param anErrorCode - contains error code resulting from parse process
|
* @param anErrorCode - contains error code resulting from parse process
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel)=0;
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink)=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called during model building phase of parse process. Each token created during
|
* Called during model building phase of parse process. Each token created during
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ nsParser::nsParser() {
|
|||||||
mObserver = 0;
|
mObserver = 0;
|
||||||
mSink=0;
|
mSink=0;
|
||||||
mParserContext=0;
|
mParserContext=0;
|
||||||
mParseLevel=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -320,7 +319,7 @@ PRBool FindSuitableDTD( CParserContext& aParserContext) {
|
|||||||
if(theDTD) {
|
if(theDTD) {
|
||||||
result=theDTD->CanParse(aParserContext.mSourceType,0);
|
result=theDTD->CanParse(aParserContext.mSourceType,0);
|
||||||
if(result){
|
if(result){
|
||||||
nsresult status=theDTD->CreateNewInstance(&aParserContext.mDTD);
|
theDTD->CreateNewInstance(&aParserContext.mDTD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -386,7 +385,7 @@ PRInt32 nsParser::WillBuildModel(nsString& aFilename){
|
|||||||
if(PR_TRUE==FindSuitableDTD(*mParserContext)) {
|
if(PR_TRUE==FindSuitableDTD(*mParserContext)) {
|
||||||
mParserContext->mDTD->SetParser(this);
|
mParserContext->mDTD->SetParser(this);
|
||||||
mParserContext->mDTD->SetContentSink(mSink);
|
mParserContext->mDTD->SetContentSink(mSink);
|
||||||
mParserContext->mDTD->WillBuildModel(aFilename,mParseLevel);
|
mParserContext->mDTD->WillBuildModel(aFilename,PRBool(0==mParserContext->mPrevContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
return kNoError;
|
return kNoError;
|
||||||
@@ -402,7 +401,7 @@ PRInt32 nsParser::DidBuildModel(PRInt32 anErrorCode) {
|
|||||||
//One last thing...close any open containers.
|
//One last thing...close any open containers.
|
||||||
PRInt32 result=anErrorCode;
|
PRInt32 result=anErrorCode;
|
||||||
if(mParserContext->mDTD) {
|
if(mParserContext->mDTD) {
|
||||||
result=mParserContext->mDTD->DidBuildModel(anErrorCode,mParseLevel);
|
result=mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -455,7 +454,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug *
|
|||||||
NS_PRECONDITION(0!=aURL,kNullURL);
|
NS_PRECONDITION(0!=aURL,kNullURL);
|
||||||
|
|
||||||
PRInt32 status=kBadURL;
|
PRInt32 status=kBadURL;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
/* Disable DTD Debug for now...
|
/* Disable DTD Debug for now...
|
||||||
mDTDDebug = aDTDDebug;
|
mDTDDebug = aDTDDebug;
|
||||||
@@ -481,7 +479,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug *
|
|||||||
PRInt32 nsParser::Parse(fstream& aStream){
|
PRInt32 nsParser::Parse(fstream& aStream){
|
||||||
|
|
||||||
PRInt32 status=kNoError;
|
PRInt32 status=kNoError;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
//ok, time to create our tokenizer and begin the process
|
//ok, time to create our tokenizer and begin the process
|
||||||
CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0);
|
CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0);
|
||||||
@@ -497,7 +494,6 @@ PRInt32 nsParser::Parse(fstream& aStream){
|
|||||||
|
|
||||||
pc=PopContext();
|
pc=PopContext();
|
||||||
delete pc;
|
delete pc;
|
||||||
mParseLevel--;
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -515,7 +511,6 @@ PRInt32 nsParser::Parse(fstream& aStream){
|
|||||||
*/
|
*/
|
||||||
PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
||||||
PRInt32 result=kNoError;
|
PRInt32 result=kNoError;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0);
|
CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0);
|
||||||
|
|
||||||
@@ -529,7 +524,6 @@ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
|||||||
}
|
}
|
||||||
pc=PopContext();
|
pc=PopContext();
|
||||||
delete pc;
|
delete pc;
|
||||||
mParseLevel--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,7 +847,7 @@ PRInt32 nsParser::Tokenize(){
|
|||||||
mParserContext->mScanner->RewindToMark();
|
mParserContext->mScanner->RewindToMark();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(result=kProcessComplete)
|
if(kProcessComplete==result)
|
||||||
result=NS_OK;
|
result=NS_OK;
|
||||||
DidTokenize();
|
DidTokenize();
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -294,7 +294,6 @@ protected:
|
|||||||
CParserContext* mParserContext;
|
CParserContext* mParserContext;
|
||||||
PRInt32 mMajorIteration;
|
PRInt32 mMajorIteration;
|
||||||
PRInt32 mMinorIteration;
|
PRInt32 mMinorIteration;
|
||||||
PRInt32 mParseLevel;
|
|
||||||
|
|
||||||
nsIStreamObserver* mObserver;
|
nsIStreamObserver* mObserver;
|
||||||
nsIContentSink* mSink;
|
nsIContentSink* mSink;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ nsCParserNode::~nsCParserNode() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void nsCParserNode::AddAttribute(CToken* aToken) {
|
void nsCParserNode::AddAttribute(CToken* aToken) {
|
||||||
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes), "Buffer overrun!");
|
NS_PRECONDITION(mAttributeCount<PRInt32(sizeof(mAttributes)), "Buffer overrun!");
|
||||||
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
||||||
if(aToken) {
|
if(aToken) {
|
||||||
mAttributes[mAttributeCount++]=aToken;
|
mAttributes[mAttributeCount++]=aToken;
|
||||||
@@ -78,7 +78,7 @@ void nsCParserNode::AddAttribute(CToken* aToken) {
|
|||||||
* @return nada
|
* @return nada
|
||||||
*/
|
*/
|
||||||
void nsCParserNode::SetSkippedContent(CToken* aToken){
|
void nsCParserNode::SetSkippedContent(CToken* aToken){
|
||||||
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes)-1, "Buffer overrun!");
|
NS_PRECONDITION(mAttributeCount<PRInt32(sizeof(mAttributes)-1), "Buffer overrun!");
|
||||||
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
||||||
if(aToken) {
|
if(aToken) {
|
||||||
mAttributes[mAttributeCount++]=aToken;
|
mAttributes[mAttributeCount++]=aToken;
|
||||||
|
|||||||
@@ -403,7 +403,6 @@ nsresult CScanner::ReadWhile(nsString& aString,
|
|||||||
PRBool addTerminal){
|
PRBool addTerminal){
|
||||||
PRUnichar theChar=0;
|
PRUnichar theChar=0;
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
PRInt32 wrPos=0;
|
|
||||||
|
|
||||||
while(NS_OK==result) {
|
while(NS_OK==result) {
|
||||||
result=GetChar(theChar);
|
result=GetChar(theChar);
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include "nsToken.h"
|
#include "nsToken.h"
|
||||||
#include "nsParserTypes.h"
|
#include "nsParserTypes.h"
|
||||||
|
|
||||||
static const char* kNullParserGiven = "Error: Null parser given as argument";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_VALID_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_VALID_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kRTFTextContentType = "text/xml";
|
static const char* kXMLTextContentType = "text/xml";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ nsresult CValidDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){
|
|||||||
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
PRBool CValidDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
PRBool CValidDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
||||||
PRBool result=aContentType.Equals(kRTFTextContentType);
|
PRBool result=aContentType.Equals(kXMLTextContentType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ eAutoDetectResult CValidDTD::AutoDetectContentType(nsString& aBuffer,nsString& a
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CValidDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP CValidDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class CValidDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -128,7 +128,7 @@ class CValidDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kRTFTextContentType = "text/xml";
|
static const char* kXMLTextContentType = "text/xml";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ nsresult CWellFormedDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){
|
|||||||
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
PRBool CWellFormedDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
PRBool CWellFormedDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
||||||
PRBool result=aContentType.Equals(kRTFTextContentType);
|
PRBool result=aContentType.Equals(kXMLTextContentType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ eAutoDetectResult CWellFormedDTD::AutoDetectContentType(nsString& aBuffer,nsStri
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel)
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class CWellFormedDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -118,7 +118,7 @@ class CWellFormedDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ eAutoDetectResult nsXIFDTD::AutoDetectContentType(nsString& aBuffer,nsString& aT
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRInt32 aLevel){
|
nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
if(mSink)
|
if(mSink)
|
||||||
@@ -432,7 +432,7 @@ nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
if(mSink)
|
if(mSink)
|
||||||
@@ -931,6 +931,9 @@ PRBool nsXIFDTD::IsHTMLContainer(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_hr:
|
case eHTMLTag_hr:
|
||||||
result=PR_FALSE;
|
result=PR_FALSE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -957,6 +960,10 @@ eXIFTags nsXIFDTD::GetDefaultParentTagFor(eXIFTags aTag) const{
|
|||||||
case eXIFTag_section_body:
|
case eXIFTag_section_body:
|
||||||
case eXIFTag_section_head:
|
case eXIFTag_section_head:
|
||||||
result=eXIFTag_section; break;
|
result=eXIFTag_section; break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class nsXIFDTD : public nsIDTD {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFileName,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFileName,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -169,7 +169,7 @@ class nsXIFDTD : public nsIDTD {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -43,9 +43,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||||||
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
||||||
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_INAVHTML_DTD_IID);
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
|
||||||
static const char* kNullToken = "Error: Null token given";
|
static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kHTMLTextContentType = "text/html";
|
static const char* kHTMLTextContentType = "text/html";
|
||||||
@@ -335,8 +334,7 @@ static CNavTokenDeallocator gTokenKiller;
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CNavDTD::CNavDTD() : nsIDTD(), mTokenDeque(gTokenKiller),
|
CNavDTD::CNavDTD() : nsIDTD(), mContextStack(), mStyleStack(), mTokenDeque(gTokenKiller) {
|
||||||
mContextStack(), mStyleStack() {
|
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
mParser=0;
|
mParser=0;
|
||||||
mSink = nsnull;
|
mSink = nsnull;
|
||||||
@@ -423,12 +421,12 @@ eAutoDetectResult CNavDTD::AutoDetectContentType(nsString& aBuffer,nsString& aTy
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
mFilename=aFilename;
|
mFilename=aFilename;
|
||||||
|
|
||||||
if((1==aLevel) && (mSink)) {
|
if((aNotifySink) && (mSink)) {
|
||||||
mLineNumber=1;
|
mLineNumber=1;
|
||||||
result = mSink->WillBuildModel();
|
result = mSink->WillBuildModel();
|
||||||
}
|
}
|
||||||
@@ -442,14 +440,14 @@ nsresult CNavDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
nsresult CNavDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result= NS_OK;
|
nsresult result= NS_OK;
|
||||||
|
|
||||||
if((kNoError==anErrorCode) && (mContextStack.mCount>0)) {
|
if((kNoError==anErrorCode) && (mContextStack.mCount>0)) {
|
||||||
result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
|
result = CloseContainersTo(0,eHTMLTag_unknown,PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((1==aLevel) && (mSink)) {
|
if((aNotifySink) && (mSink)) {
|
||||||
result = mSink->DidBuildModel(1);
|
result = mSink->DidBuildModel(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -818,9 +816,7 @@ nsresult CNavDTD::HandleAttributeToken(CToken* aToken) {
|
|||||||
NS_PRECONDITION(0!=aToken,kNullToken);
|
NS_PRECONDITION(0!=aToken,kNullToken);
|
||||||
NS_ERROR("attribute encountered -- this shouldn't happen!");
|
NS_ERROR("attribute encountered -- this shouldn't happen!");
|
||||||
|
|
||||||
CAttributeToken* at = (CAttributeToken*)(aToken);
|
return NS_OK;
|
||||||
nsresult result=NS_OK;
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -872,9 +868,8 @@ nsresult CNavDTD::HandleScriptToken(CToken* aToken, nsCParserNode& aNode) {
|
|||||||
nsresult CNavDTD::HandleStyleToken(CToken* aToken){
|
nsresult CNavDTD::HandleStyleToken(CToken* aToken){
|
||||||
NS_PRECONDITION(0!=aToken,kNullToken);
|
NS_PRECONDITION(0!=aToken,kNullToken);
|
||||||
|
|
||||||
CStyleToken* st = (CStyleToken*)(aToken);
|
// CStyleToken* st = (CStyleToken*)(aToken);
|
||||||
nsresult result=NS_OK;
|
return NS_OK;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -924,7 +919,6 @@ CITokenHandler* CNavDTD::AddTokenHandler(CITokenHandler* aHandler) {
|
|||||||
if(aHandler) {
|
if(aHandler) {
|
||||||
eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType();
|
eHTMLTokenTypes type=(eHTMLTokenTypes)aHandler->GetTokenType();
|
||||||
if(type<eToken_last) {
|
if(type<eToken_last) {
|
||||||
CITokenHandler* old=mTokenHandlers[type];
|
|
||||||
mTokenHandlers[type]=aHandler;
|
mTokenHandlers[type]=aHandler;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1739,7 +1733,6 @@ PRBool CNavDTD::ForwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTag
|
|||||||
*/
|
*/
|
||||||
PRBool CNavDTD::BackwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTags aChildTag) const {
|
PRBool CNavDTD::BackwardPropagate(nsString& aVector,eHTMLTags aParentTag,eHTMLTags aChildTag) const {
|
||||||
|
|
||||||
PRBool result=PR_FALSE;
|
|
||||||
eHTMLTags theParentTag=(eHTMLTags)aChildTag;
|
eHTMLTags theParentTag=(eHTMLTags)aChildTag;
|
||||||
|
|
||||||
// aVector.Truncate();
|
// aVector.Truncate();
|
||||||
@@ -2199,9 +2192,6 @@ CNavDTD::OpenContainer(const nsIParserNode& aNode,PRBool aUpdateStyleStack){
|
|||||||
|
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
eHTMLTags nodeType=(eHTMLTags)aNode.GetNodeType();
|
eHTMLTags nodeType=(eHTMLTags)aNode.GetNodeType();
|
||||||
PRInt32 num=aNode.GetSourceLineNumber();
|
|
||||||
|
|
||||||
// CloseTransientStyles(nodeType);
|
|
||||||
|
|
||||||
switch(nodeType) {
|
switch(nodeType) {
|
||||||
|
|
||||||
@@ -2880,7 +2870,8 @@ nsresult CNavDTD::ConsumeComment(PRUnichar aChar,CScanner& aScanner,CToken*& aTo
|
|||||||
*/
|
*/
|
||||||
nsresult CNavDTD::ConsumeText(const nsString& aString,CScanner& aScanner,CToken*& aToken){
|
nsresult CNavDTD::ConsumeText(const nsString& aString,CScanner& aScanner,CToken*& aToken){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
if(aToken=new CTextToken(aString)) {
|
aToken=new CTextToken(aString);
|
||||||
|
if(aToken) {
|
||||||
PRUnichar ch=0;
|
PRUnichar ch=0;
|
||||||
result=aToken->Consume(ch,aScanner);
|
result=aToken->Consume(ch,aScanner);
|
||||||
if(result) {
|
if(result) {
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -231,7 +231,7 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called by the parser, once for each token
|
* This method is called by the parser, once for each token
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_IOtherHTML_DTD_IID);
|
||||||
static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID);
|
static NS_DEFINE_IID(kBaseClassIID, NS_INAVHTML_DTD_IID);
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kHTMLTextContentType = "text/html";
|
//static const char* kHTMLTextContentType = "text/html";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -189,8 +189,8 @@ eAutoDetectResult COtherDTD::AutoDetectContentType(nsString& aBuffer,nsString& a
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) {
|
NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink) {
|
||||||
return CNavDTD::WillBuildModel(aFilename, aLevel);
|
return CNavDTD::WillBuildModel(aFilename, aNotifySink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -199,8 +199,8 @@ NS_IMETHODIMP COtherDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel) {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP COtherDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
return CNavDTD::DidBuildModel(anErrorCode, aLevel);
|
return CNavDTD::DidBuildModel(anErrorCode, aNotifySink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class COtherDTD : public CNavDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -107,7 +107,7 @@ class COtherDTD : public CNavDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_RTF_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
|
||||||
static const char* kNullToken = "Error: Null token given";
|
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
|
||||||
static const char* kRTFTextContentType = "application/rtf";
|
static const char* kRTFTextContentType = "application/rtf";
|
||||||
static const char* kRTFDocHeader= "{\\rtf0";
|
static const char* kRTFDocHeader= "{\\rtf0";
|
||||||
static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
static nsString gAlphaChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
||||||
@@ -119,7 +114,6 @@ static RTFEntry gRTFTable[] = {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
const char* GetTagName(eRTFTags aTag) {
|
const char* GetTagName(eRTFTags aTag) {
|
||||||
const char* result=0;
|
|
||||||
PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry);
|
PRInt32 cnt=sizeof(gRTFTable)/sizeof(RTFEntry);
|
||||||
PRInt32 low=0;
|
PRInt32 low=0;
|
||||||
PRInt32 high=cnt-1;
|
PRInt32 high=cnt-1;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class CDTDDebug : public nsIDTDDebug {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
CDTDDebug(char * aVerifyDir = 0);
|
CDTDDebug(char * aVerifyDir = 0);
|
||||||
~CDTDDebug();
|
virtual ~CDTDDebug();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ void nsHTMLContentSinkStream::AddStartTag(const nsIParserNode& aNode, ostream& a
|
|||||||
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream)
|
void nsHTMLContentSinkStream::AddEndTag(const nsIParserNode& aNode, ostream& aStream)
|
||||||
{
|
{
|
||||||
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
||||||
const nsString& name = aNode.GetText();
|
// const nsString& name = aNode.GetText();
|
||||||
nsString tagName;
|
nsString tagName;
|
||||||
|
|
||||||
if (tag == eHTMLTag_unknown)
|
if (tag == eHTMLTag_unknown)
|
||||||
@@ -743,7 +743,7 @@ NS_IMETHODIMP
|
|||||||
nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){
|
nsHTMLContentSinkStream::OpenContainer(const nsIParserNode& aNode){
|
||||||
if(mOutput) {
|
if(mOutput) {
|
||||||
AddStartTag(aNode,*mOutput);
|
AddStartTag(aNode,*mOutput);
|
||||||
eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
// eHTMLTags tag = (eHTMLTags)aNode.GetNodeType();
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -886,6 +886,10 @@ PRBool nsHTMLContentSinkStream::IsInline(eHTMLTags aTag) const
|
|||||||
|
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -929,6 +933,10 @@ PRBool nsHTMLContentSinkStream::BreakAfterOpen(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_style:
|
case eHTMLTag_style:
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -951,6 +959,10 @@ PRBool nsHTMLContentSinkStream::BreakBeforeClose(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_style:
|
case eHTMLTag_style:
|
||||||
result = PR_TRUE;
|
result = PR_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -984,13 +996,6 @@ PRBool nsHTMLContentSinkStream::IndentChildren(eHTMLTags aTag) const {
|
|||||||
|
|
||||||
switch (aTag)
|
switch (aTag)
|
||||||
{
|
{
|
||||||
case eHTMLTag_html:
|
|
||||||
case eHTMLTag_pre:
|
|
||||||
case eHTMLTag_body:
|
|
||||||
case eHTMLTag_style:
|
|
||||||
result = PR_FALSE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case eHTMLTag_table:
|
case eHTMLTag_table:
|
||||||
case eHTMLTag_ul:
|
case eHTMLTag_ul:
|
||||||
case eHTMLTag_ol:
|
case eHTMLTag_ol:
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ static NS_DEFINE_IID(kIHTMLContentSinkIID, NS_IHTML_CONTENT_SINK_IID);
|
|||||||
class nsHTMLNullSink : public nsIHTMLContentSink {
|
class nsHTMLNullSink : public nsIHTMLContentSink {
|
||||||
public:
|
public:
|
||||||
nsHTMLNullSink();
|
nsHTMLNullSink();
|
||||||
~nsHTMLNullSink();
|
virtual ~nsHTMLNullSink();
|
||||||
|
|
||||||
enum eSection {eNone=0,eHTML,eHead,eBody,eContainer};
|
enum eSection {eNone=0,eHTML,eHead,eBody,eContainer};
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class nsIDTD : public nsISupports {
|
|||||||
* @param aFilename--string that contains name of file being parsed (if applicable)
|
* @param aFilename--string that contains name of file being parsed (if applicable)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel)=0;
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink)=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the parser after the parsing process has concluded
|
* Called by the parser after the parsing process has concluded
|
||||||
@@ -118,7 +118,7 @@ class nsIDTD : public nsISupports {
|
|||||||
* @param anErrorCode - contains error code resulting from parse process
|
* @param anErrorCode - contains error code resulting from parse process
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel)=0;
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink)=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called during model building phase of parse process. Each token created during
|
* Called during model building phase of parse process. Each token created during
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ nsParser::nsParser() {
|
|||||||
mObserver = 0;
|
mObserver = 0;
|
||||||
mSink=0;
|
mSink=0;
|
||||||
mParserContext=0;
|
mParserContext=0;
|
||||||
mParseLevel=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -320,7 +319,7 @@ PRBool FindSuitableDTD( CParserContext& aParserContext) {
|
|||||||
if(theDTD) {
|
if(theDTD) {
|
||||||
result=theDTD->CanParse(aParserContext.mSourceType,0);
|
result=theDTD->CanParse(aParserContext.mSourceType,0);
|
||||||
if(result){
|
if(result){
|
||||||
nsresult status=theDTD->CreateNewInstance(&aParserContext.mDTD);
|
theDTD->CreateNewInstance(&aParserContext.mDTD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -386,7 +385,7 @@ PRInt32 nsParser::WillBuildModel(nsString& aFilename){
|
|||||||
if(PR_TRUE==FindSuitableDTD(*mParserContext)) {
|
if(PR_TRUE==FindSuitableDTD(*mParserContext)) {
|
||||||
mParserContext->mDTD->SetParser(this);
|
mParserContext->mDTD->SetParser(this);
|
||||||
mParserContext->mDTD->SetContentSink(mSink);
|
mParserContext->mDTD->SetContentSink(mSink);
|
||||||
mParserContext->mDTD->WillBuildModel(aFilename,mParseLevel);
|
mParserContext->mDTD->WillBuildModel(aFilename,PRBool(0==mParserContext->mPrevContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
return kNoError;
|
return kNoError;
|
||||||
@@ -402,7 +401,7 @@ PRInt32 nsParser::DidBuildModel(PRInt32 anErrorCode) {
|
|||||||
//One last thing...close any open containers.
|
//One last thing...close any open containers.
|
||||||
PRInt32 result=anErrorCode;
|
PRInt32 result=anErrorCode;
|
||||||
if(mParserContext->mDTD) {
|
if(mParserContext->mDTD) {
|
||||||
result=mParserContext->mDTD->DidBuildModel(anErrorCode,mParseLevel);
|
result=mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -455,7 +454,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug *
|
|||||||
NS_PRECONDITION(0!=aURL,kNullURL);
|
NS_PRECONDITION(0!=aURL,kNullURL);
|
||||||
|
|
||||||
PRInt32 status=kBadURL;
|
PRInt32 status=kBadURL;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
/* Disable DTD Debug for now...
|
/* Disable DTD Debug for now...
|
||||||
mDTDDebug = aDTDDebug;
|
mDTDDebug = aDTDDebug;
|
||||||
@@ -481,7 +479,6 @@ PRInt32 nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener, nsIDTDDebug *
|
|||||||
PRInt32 nsParser::Parse(fstream& aStream){
|
PRInt32 nsParser::Parse(fstream& aStream){
|
||||||
|
|
||||||
PRInt32 status=kNoError;
|
PRInt32 status=kNoError;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
//ok, time to create our tokenizer and begin the process
|
//ok, time to create our tokenizer and begin the process
|
||||||
CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0);
|
CParserContext* pc=new CParserContext(new CScanner(kUnknownFilename,aStream,PR_FALSE),&aStream,0);
|
||||||
@@ -497,7 +494,6 @@ PRInt32 nsParser::Parse(fstream& aStream){
|
|||||||
|
|
||||||
pc=PopContext();
|
pc=PopContext();
|
||||||
delete pc;
|
delete pc;
|
||||||
mParseLevel--;
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -515,7 +511,6 @@ PRInt32 nsParser::Parse(fstream& aStream){
|
|||||||
*/
|
*/
|
||||||
PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
||||||
PRInt32 result=kNoError;
|
PRInt32 result=kNoError;
|
||||||
mParseLevel++;
|
|
||||||
|
|
||||||
CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0);
|
CParserContext* pc=new CParserContext(new CScanner(aSourceBuffer),&aSourceBuffer,0);
|
||||||
|
|
||||||
@@ -529,7 +524,6 @@ PRInt32 nsParser::Parse(nsString& aSourceBuffer,PRBool anHTMLString){
|
|||||||
}
|
}
|
||||||
pc=PopContext();
|
pc=PopContext();
|
||||||
delete pc;
|
delete pc;
|
||||||
mParseLevel--;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,7 +847,7 @@ PRInt32 nsParser::Tokenize(){
|
|||||||
mParserContext->mScanner->RewindToMark();
|
mParserContext->mScanner->RewindToMark();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(result=kProcessComplete)
|
if(kProcessComplete==result)
|
||||||
result=NS_OK;
|
result=NS_OK;
|
||||||
DidTokenize();
|
DidTokenize();
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -294,7 +294,6 @@ protected:
|
|||||||
CParserContext* mParserContext;
|
CParserContext* mParserContext;
|
||||||
PRInt32 mMajorIteration;
|
PRInt32 mMajorIteration;
|
||||||
PRInt32 mMinorIteration;
|
PRInt32 mMinorIteration;
|
||||||
PRInt32 mParseLevel;
|
|
||||||
|
|
||||||
nsIStreamObserver* mObserver;
|
nsIStreamObserver* mObserver;
|
||||||
nsIContentSink* mSink;
|
nsIContentSink* mSink;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ nsCParserNode::~nsCParserNode() {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void nsCParserNode::AddAttribute(CToken* aToken) {
|
void nsCParserNode::AddAttribute(CToken* aToken) {
|
||||||
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes), "Buffer overrun!");
|
NS_PRECONDITION(mAttributeCount<PRInt32(sizeof(mAttributes)), "Buffer overrun!");
|
||||||
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
||||||
if(aToken) {
|
if(aToken) {
|
||||||
mAttributes[mAttributeCount++]=aToken;
|
mAttributes[mAttributeCount++]=aToken;
|
||||||
@@ -78,7 +78,7 @@ void nsCParserNode::AddAttribute(CToken* aToken) {
|
|||||||
* @return nada
|
* @return nada
|
||||||
*/
|
*/
|
||||||
void nsCParserNode::SetSkippedContent(CToken* aToken){
|
void nsCParserNode::SetSkippedContent(CToken* aToken){
|
||||||
NS_PRECONDITION(mAttributeCount<sizeof(mAttributes)-1, "Buffer overrun!");
|
NS_PRECONDITION(mAttributeCount<PRInt32(sizeof(mAttributes)-1), "Buffer overrun!");
|
||||||
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
NS_PRECONDITION(0!=aToken, "Error: Token shouldn't be null!");
|
||||||
if(aToken) {
|
if(aToken) {
|
||||||
mAttributes[mAttributeCount++]=aToken;
|
mAttributes[mAttributeCount++]=aToken;
|
||||||
|
|||||||
@@ -403,7 +403,6 @@ nsresult CScanner::ReadWhile(nsString& aString,
|
|||||||
PRBool addTerminal){
|
PRBool addTerminal){
|
||||||
PRUnichar theChar=0;
|
PRUnichar theChar=0;
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
PRInt32 wrPos=0;
|
|
||||||
|
|
||||||
while(NS_OK==result) {
|
while(NS_OK==result) {
|
||||||
result=GetChar(theChar);
|
result=GetChar(theChar);
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include "nsToken.h"
|
#include "nsToken.h"
|
||||||
#include "nsParserTypes.h"
|
#include "nsParserTypes.h"
|
||||||
|
|
||||||
static const char* kNullParserGiven = "Error: Null parser given as argument";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_VALID_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_VALID_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kRTFTextContentType = "text/xml";
|
static const char* kXMLTextContentType = "text/xml";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ nsresult CValidDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){
|
|||||||
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
PRBool CValidDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
PRBool CValidDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
||||||
PRBool result=aContentType.Equals(kRTFTextContentType);
|
PRBool result=aContentType.Equals(kXMLTextContentType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ eAutoDetectResult CValidDTD::AutoDetectContentType(nsString& aBuffer,nsString& a
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ NS_IMETHODIMP CValidDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CValidDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP CValidDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class CValidDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -128,7 +128,7 @@ class CValidDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -55,12 +55,12 @@ static NS_DEFINE_IID(kIDTDIID, NS_IDTD_IID);
|
|||||||
static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID);
|
static NS_DEFINE_IID(kClassIID, NS_WELLFORMED_DTD_IID);
|
||||||
|
|
||||||
|
|
||||||
static const char* kNullURL = "Error: Null URL given";
|
//static const char* kNullURL = "Error: Null URL given";
|
||||||
static const char* kNullFilename= "Error: Null filename given";
|
//static const char* kNullFilename= "Error: Null filename given";
|
||||||
static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
//static const char* kNullTokenizer = "Error: Unable to construct tokenizer";
|
||||||
static const char* kNullToken = "Error: Null token given";
|
//static const char* kNullToken = "Error: Null token given";
|
||||||
static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
//static const char* kInvalidTagStackPos = "Error: invalid tag stack position";
|
||||||
static const char* kRTFTextContentType = "text/xml";
|
static const char* kXMLTextContentType = "text/xml";
|
||||||
|
|
||||||
static nsAutoString gEmpty;
|
static nsAutoString gEmpty;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ nsresult CWellFormedDTD::CreateNewInstance(nsIDTD** aInstancePtrResult){
|
|||||||
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
* @return TRUE if this DTD can satisfy the request; FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
PRBool CWellFormedDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
PRBool CWellFormedDTD::CanParse(nsString& aContentType, PRInt32 aVersion){
|
||||||
PRBool result=aContentType.Equals(kRTFTextContentType);
|
PRBool result=aContentType.Equals(kXMLTextContentType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ eAutoDetectResult CWellFormedDTD::AutoDetectContentType(nsString& aBuffer,nsStri
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel){
|
NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ NS_IMETHODIMP CWellFormedDTD::WillBuildModel(nsString& aFilename,PRInt32 aLevel)
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
NS_IMETHODIMP CWellFormedDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class CWellFormedDTD : public nsIDTD {
|
|||||||
* @param aFilename is the name of the file being parsed.
|
* @param aFilename is the name of the file being parsed.
|
||||||
* @return error code (almost always 0)
|
* @return error code (almost always 0)
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFilename,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFilename,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The parser uses a code sandwich to wrap the parsing process. Before
|
* The parser uses a code sandwich to wrap the parsing process. Before
|
||||||
@@ -118,7 +118,7 @@ class CWellFormedDTD : public nsIDTD {
|
|||||||
* @param anErrorCode contans the last error that occured
|
* @param anErrorCode contans the last error that occured
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ eAutoDetectResult nsXIFDTD::AutoDetectContentType(nsString& aBuffer,nsString& aT
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRInt32 aLevel){
|
nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
if(mSink)
|
if(mSink)
|
||||||
@@ -432,7 +432,7 @@ nsresult nsXIFDTD::WillBuildModel(nsString& aFileName,PRInt32 aLevel){
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRInt32 aLevel){
|
nsresult nsXIFDTD::DidBuildModel(PRInt32 anErrorCode,PRBool aNotifySink){
|
||||||
nsresult result=NS_OK;
|
nsresult result=NS_OK;
|
||||||
|
|
||||||
if(mSink)
|
if(mSink)
|
||||||
@@ -931,6 +931,9 @@ PRBool nsXIFDTD::IsHTMLContainer(eHTMLTags aTag) const {
|
|||||||
case eHTMLTag_hr:
|
case eHTMLTag_hr:
|
||||||
result=PR_FALSE;
|
result=PR_FALSE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -957,6 +960,10 @@ eXIFTags nsXIFDTD::GetDefaultParentTagFor(eXIFTags aTag) const{
|
|||||||
case eXIFTag_section_body:
|
case eXIFTag_section_body:
|
||||||
case eXIFTag_section_head:
|
case eXIFTag_section_head:
|
||||||
result=eXIFTag_section; break;
|
result=eXIFTag_section; break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class nsXIFDTD : public nsIDTD {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD WillBuildModel(nsString& aFileName,PRInt32 aLevel);
|
NS_IMETHOD WillBuildModel(nsString& aFileName,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -169,7 +169,7 @@ class nsXIFDTD : public nsIDTD {
|
|||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel,PRInt32 aLevel);
|
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel,PRBool aNotifySink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const
|
|||||||
float nsString::ToFloat(PRInt32* aErrorCode) const
|
float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
if (mLength > sizeof(buf)-1) {
|
if (mLength > PRInt32(sizeof(buf)-1)) {
|
||||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -995,8 +993,6 @@ PRInt32 nsString::Insert(PRUnichar aChar,PRInt32 anOffset){
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -1280,7 +1276,6 @@ PRInt32 nsString::Find(const nsString& aString) const{
|
|||||||
* @return offset of found char, or -1 (kNotFound)
|
* @return offset of found char, or -1 (kNotFound)
|
||||||
*------------------------------------------------------*/
|
*------------------------------------------------------*/
|
||||||
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
||||||
PRInt32 result=0;
|
|
||||||
|
|
||||||
for(PRInt32 i=anOffset;i<mLength;i++)
|
for(PRInt32 i=anOffset;i<mLength;i++)
|
||||||
if(aChar==mStr[i])
|
if(aChar==mStr[i])
|
||||||
@@ -2071,7 +2066,7 @@ NS_BASE int fputs(const nsString& aString, FILE* out)
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
char* cp = buf;
|
char* cp = buf;
|
||||||
PRInt32 len = aString.Length();
|
PRInt32 len = aString.Length();
|
||||||
if (len >= sizeof(buf)) {
|
if (len >= PRInt32(sizeof(buf))) {
|
||||||
cp = aString.ToNewCString();
|
cp = aString.ToNewCString();
|
||||||
} else {
|
} else {
|
||||||
aString.ToCString(cp, len + 1);
|
aString.ToCString(cp, len + 1);
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ nsBTree::~nsBTree(){
|
|||||||
* @return ptr to added node or NULL
|
* @return ptr to added node or NULL
|
||||||
*/
|
*/
|
||||||
nsNode* nsBTree::Add(nsNode& aNode){
|
nsNode* nsBTree::Add(nsNode& aNode){
|
||||||
PRBool result=PR_TRUE;
|
|
||||||
|
|
||||||
nsNode* node1=mRoot; //x
|
nsNode* node1=mRoot; //x
|
||||||
nsNode* node2=0; //y
|
nsNode* node2=0; //y
|
||||||
@@ -225,7 +224,7 @@ nsBTree& nsBTree::Empty(nsNode* aNode) {
|
|||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
nsBTree& nsBTree::Erase(nsNode* aNode){
|
nsBTree& nsBTree::Erase(nsNode* aNode){
|
||||||
nsNode* node1 =(aNode) ? aNode : mRoot;
|
// nsNode* node1 =(aNode) ? aNode : mRoot;
|
||||||
|
|
||||||
if(aNode) {
|
if(aNode) {
|
||||||
Erase(aNode->mLeft); //begin by walking left side
|
Erase(aNode->mLeft); //begin by walking left side
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
friend class nsBTreeIterator;
|
friend class nsBTreeIterator;
|
||||||
|
|
||||||
nsBTree();
|
nsBTree();
|
||||||
~nsBTree();
|
virtual ~nsBTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add given node reference into our tree.
|
* Add given node reference into our tree.
|
||||||
|
|||||||
@@ -245,8 +245,7 @@ const void* nsDeque::ForEach(nsDequeFunctor& aFunctor) const{
|
|||||||
* @param aQueue is the deque object to be iterated
|
* @param aQueue is the deque object to be iterated
|
||||||
* @param anIndex is the starting position for your iteration
|
* @param anIndex is the starting position for your iteration
|
||||||
*/
|
*/
|
||||||
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQueue) {
|
nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mIndex(anIndex), mDeque(aQueue) {
|
||||||
mIndex=anIndex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -256,9 +255,7 @@ nsDequeIterator::nsDequeIterator(const nsDeque& aQueue,int anIndex): mDeque(aQue
|
|||||||
* @param aCopy is another iterator to copy from
|
* @param aCopy is another iterator to copy from
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) :
|
nsDequeIterator::nsDequeIterator(const nsDequeIterator& aCopy) : mIndex(aCopy.mIndex), mDeque(aCopy.mDeque) {
|
||||||
mDeque(aCopy.mDeque),
|
|
||||||
mIndex(aCopy.mIndex) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ friend class NS_BASE nsRBTreeIterator;
|
|||||||
*
|
*
|
||||||
* @update gess 4/11/98
|
* @update gess 4/11/98
|
||||||
*/
|
*/
|
||||||
~nsRBTree();
|
virtual ~nsRBTree();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a node, we're supposed to add it into
|
* Given a node, we're supposed to add it into
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const
|
|||||||
float nsString::ToFloat(PRInt32* aErrorCode) const
|
float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
if (mLength > sizeof(buf)-1) {
|
if (mLength > PRInt32(sizeof(buf)-1)) {
|
||||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -995,8 +993,6 @@ PRInt32 nsString::Insert(PRUnichar aChar,PRInt32 anOffset){
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -1280,7 +1276,6 @@ PRInt32 nsString::Find(const nsString& aString) const{
|
|||||||
* @return offset of found char, or -1 (kNotFound)
|
* @return offset of found char, or -1 (kNotFound)
|
||||||
*------------------------------------------------------*/
|
*------------------------------------------------------*/
|
||||||
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
||||||
PRInt32 result=0;
|
|
||||||
|
|
||||||
for(PRInt32 i=anOffset;i<mLength;i++)
|
for(PRInt32 i=anOffset;i<mLength;i++)
|
||||||
if(aChar==mStr[i])
|
if(aChar==mStr[i])
|
||||||
@@ -2071,7 +2066,7 @@ NS_BASE int fputs(const nsString& aString, FILE* out)
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
char* cp = buf;
|
char* cp = buf;
|
||||||
PRInt32 len = aString.Length();
|
PRInt32 len = aString.Length();
|
||||||
if (len >= sizeof(buf)) {
|
if (len >= PRInt32(sizeof(buf))) {
|
||||||
cp = aString.ToNewCString();
|
cp = aString.ToNewCString();
|
||||||
} else {
|
} else {
|
||||||
aString.ToCString(cp, len + 1);
|
aString.ToCString(cp, len + 1);
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ char* nsString::ToCString(char* aBuf, PRInt32 aBufLength) const
|
|||||||
float nsString::ToFloat(PRInt32* aErrorCode) const
|
float nsString::ToFloat(PRInt32* aErrorCode) const
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
if (mLength > sizeof(buf)-1) {
|
if (mLength > PRInt32(sizeof(buf)-1)) {
|
||||||
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
*aErrorCode = (PRInt32) NS_ERROR_ILLEGAL_VALUE;
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -950,8 +950,6 @@ PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -995,8 +993,6 @@ PRInt32 nsString::Insert(PRUnichar aChar,PRInt32 anOffset){
|
|||||||
|
|
||||||
//Copy rightmost chars, up to offset+aCount...
|
//Copy rightmost chars, up to offset+aCount...
|
||||||
while(first<last) {
|
while(first<last) {
|
||||||
char ch1=char(*last);
|
|
||||||
char ch2=char(*next);
|
|
||||||
*next=*last;
|
*next=*last;
|
||||||
next--;
|
next--;
|
||||||
last--;
|
last--;
|
||||||
@@ -1280,7 +1276,6 @@ PRInt32 nsString::Find(const nsString& aString) const{
|
|||||||
* @return offset of found char, or -1 (kNotFound)
|
* @return offset of found char, or -1 (kNotFound)
|
||||||
*------------------------------------------------------*/
|
*------------------------------------------------------*/
|
||||||
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
PRInt32 nsString::Find(PRUnichar aChar, PRInt32 anOffset) const{
|
||||||
PRInt32 result=0;
|
|
||||||
|
|
||||||
for(PRInt32 i=anOffset;i<mLength;i++)
|
for(PRInt32 i=anOffset;i<mLength;i++)
|
||||||
if(aChar==mStr[i])
|
if(aChar==mStr[i])
|
||||||
@@ -2071,7 +2066,7 @@ NS_BASE int fputs(const nsString& aString, FILE* out)
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
char* cp = buf;
|
char* cp = buf;
|
||||||
PRInt32 len = aString.Length();
|
PRInt32 len = aString.Length();
|
||||||
if (len >= sizeof(buf)) {
|
if (len >= PRInt32(sizeof(buf))) {
|
||||||
cp = aString.ToNewCString();
|
cp = aString.ToNewCString();
|
||||||
} else {
|
} else {
|
||||||
aString.ToCString(cp, len + 1);
|
aString.ToCString(cp, len + 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user