Callback added to XML printer, too; fixed off-by-one error.

This commit is contained in:
Jim Derry 2015-11-29 07:39:33 +08:00
parent 3b8ad7482e
commit 873794162a

View file

@ -2124,7 +2124,7 @@ void TY_(PPrintTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
if (doc->progressCallback) if (doc->progressCallback)
{ {
doc->progressCallback( tidyImplToDoc(doc), node->line, node->column, doc->pprint.line ); doc->progressCallback( tidyImplToDoc(doc), node->line, node->column, doc->pprint.line + 1 );
} }
if (node->type == TextNode) if (node->type == TextNode)
@ -2391,6 +2391,11 @@ void TY_(PPrintXMLTree)( TidyDocImpl* doc, uint mode, uint indent, Node *node )
if (node == NULL) if (node == NULL)
return; return;
if (doc->progressCallback)
{
doc->progressCallback( tidyImplToDoc(doc), node->line, node->column, doc->pprint.line + 1 );
}
if ( node->type == TextNode) if ( node->type == TextNode)
{ {
PPrintText( doc, mode, indent, node ); PPrintText( doc, mode, indent, node );