bug 323908: Pass line and column information to ReportError. Patch by Robert Sayre <sayrer@gmail.com>. r=mrbkap sr=jst

This commit is contained in:
mrbkap%gmail.com 2006-01-21 02:02:02 +00:00
Родитель 1456073f60
Коммит 0a86b61aab
10 изменённых файлов: 39 добавлений и 13 удалений

Просмотреть файл

@ -203,7 +203,9 @@ nsXBLContentSink::FlushText(PRBool aCreateTextNode,
NS_IMETHODIMP
nsXBLContentSink::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
// XXX We should make sure the binding has no effect, but that it also
// gets destroyed properly without leaking. Perhaps we should even
@ -232,7 +234,10 @@ nsXBLContentSink::ReportError(const PRUnichar* aErrorText,
#endif
// Most of what this does won't be too useful, but whatever...
return nsXMLContentSink::ReportError(aErrorText, aSourceText);
return nsXMLContentSink::ReportError(aErrorText,
aSourceText,
aLineNumber,
aColumnNumber);
}
nsresult

Просмотреть файл

@ -146,7 +146,9 @@ protected:
// nsIExpatSink overrides
NS_IMETHOD ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText);
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber);
protected:
nsresult ReportUnexpectedElement(nsIAtom* aElementName, PRUint32 aLineNumber);

Просмотреть файл

@ -200,7 +200,9 @@ nsLoadSaveContentSink::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
nsLoadSaveContentSink::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
// XXX Do error reporting here. I see no reason to call ReportError
// on the "base" sink; all we need to do is drop the document on the

Просмотреть файл

@ -1204,7 +1204,9 @@ nsXMLContentSink::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
nsXMLContentSink::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
nsresult rv = NS_OK;

Просмотреть файл

@ -75,7 +75,9 @@ public:
const PRUnichar *aEncoding,
PRInt32 aStandalone);
NS_IMETHOD ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText);
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber);
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
@ -303,7 +305,9 @@ nsXMLFragmentContentSink::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
nsXMLFragmentContentSink::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
mParseError = PR_TRUE;
// The following error reporting is copied from nsXBLContentSink::ReportError()

Просмотреть файл

@ -233,7 +233,9 @@ txStylesheetSink::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
txStylesheetSink::ReportError(const PRUnichar *aErrorText,
const PRUnichar *aSourceText)
const PRUnichar *aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
mCompiler->cancel(NS_ERROR_FAILURE, aErrorText, aSourceText);

Просмотреть файл

@ -982,7 +982,9 @@ XULContentSinkImpl::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
XULContentSinkImpl::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
nsresult rv = NS_OK;

Просмотреть файл

@ -43,7 +43,7 @@
* by any sink that handles some sort of XML dialect.
*/
[scriptable, uuid(1DEEA160-C661-11d5-84CC-0010A4E0C706)]
[scriptable, uuid(34CB3B34-7F15-4971-B262-370CE61ADE4D)]
interface nsIExpatSink : nsISupports
{
/**
@ -130,5 +130,7 @@ interface nsIExpatSink : nsISupports
in long aStandalone);
void ReportError(in wstring aErrorText,
in wstring aSourceText);
in wstring aSourceText,
in long aLineNumber,
in long aColumnNumber);
};

Просмотреть файл

@ -825,7 +825,10 @@ nsExpatDriver::HandleError()
NS_ASSERTION(mSink, "no sink?");
if (mSink) {
mSink->ReportError(errorText.get(), sourceText.get());
mSink->ReportError(errorText.get(),
sourceText.get(),
lineNumber,
colNumber);
}
return NS_ERROR_HTMLPARSER_STOPPARSING;

Просмотреть файл

@ -584,7 +584,9 @@ RDFContentSinkImpl::HandleXMLDeclaration(const PRUnichar *aVersion,
NS_IMETHODIMP
RDFContentSinkImpl::ReportError(const PRUnichar* aErrorText,
const PRUnichar* aSourceText)
const PRUnichar* aSourceText,
PRInt32 aLineNumber,
PRInt32 aColumnNumber)
{
return NS_OK;
}