Migrated messages using formatter formatBadArgument to new message system. All tests passing.

This commit is contained in:
Jim Derry 2017-09-02 18:00:46 -04:00
parent 46aa9605ee
commit 0c8f684a4b
2 changed files with 13 additions and 19 deletions

View File

@ -448,8 +448,12 @@ TidyMessageImpl *formatBadArgument(TidyDocImpl* doc, Node *element, Node *node,
{
ctmbstr option;
if ( (option = va_arg( args, ctmbstr)) )
return TY_(tidyMessageCreate)( doc, code, level, option );
switch ( code )
{
case STRING_MISSING_MALFORMED:
if ( (option = va_arg( args, ctmbstr)) )
return TY_(tidyMessageCreate)( doc, code, level, option );
}
return NULL;
}
@ -713,11 +717,12 @@ void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code)
TY_(Report)(doc, NULL, node, code, av);
}
//void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option )
//{
// assert( option != NULL );
// TY_(Report)(doc, NULL, NULL, STRING_MISSING_MALFORMED, option);
//}
void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option )
{
assert( option != NULL );
TY_(Report)(doc, NULL, NULL, STRING_MISSING_MALFORMED, option);
}
/*********************************************************************
@ -906,16 +911,6 @@ void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level, uint
}
/* lexer is not defined when this is called */
void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option )
{
TidyMessageImpl *message;
assert( option != NULL );
message = TY_(tidyMessageCreate)( doc, STRING_MISSING_MALFORMED, TidyConfig, option );
messageOut( message );
}
void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded)
{
TidyMessageImpl *message = NULL;

View File

@ -57,6 +57,7 @@ void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code);
void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code);
void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option );
/** @} */
@ -65,8 +66,6 @@ void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code);
void TY_(FileError)( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level, uint code );
//void TY_(ReportAttrError)( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
void TY_(ReportBadArgument)( TidyDocImpl* doc, ctmbstr option );
void TY_(ReportEncodingError)(TidyDocImpl* doc, uint code, uint c, Bool discarded);
void TY_(ReportEncodingWarning)(TidyDocImpl* doc, uint code, uint encoding);
void TY_(ReportEntityError)( TidyDocImpl* doc, uint code, ctmbstr entity, int c );