Skip to content

Commit

Permalink
Output number of different pages in verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalmind authored and vslavik committed Jan 8, 2020
1 parent 82f6a19 commit f0ea560
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions diff-pdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ bool doc_compare(PopplerDocument *doc1, PopplerDocument *doc2,
wxProgressDialog *progress = NULL,
Gutter *gutter = NULL)
{
bool are_same = true;
int pages_differ = 0;

cairo_surface_t *surface_out = NULL;
cairo_t *cr_out = NULL;
Expand All @@ -377,7 +377,6 @@ bool doc_compare(PopplerDocument *doc1, PopplerDocument *doc2,
{
if ( g_verbose )
printf("pages count differs: %d vs %d\n", pages1, pages2);
are_same = false;
}

for ( int page = 0; page < pages_total; page++ )
Expand Down Expand Up @@ -455,7 +454,7 @@ bool doc_compare(PopplerDocument *doc1, PopplerDocument *doc2,

if ( !page_same )
{
are_same = false;
pages_differ ++;

if ( g_verbose )
printf("page %d differs\n", page);
Expand All @@ -475,7 +474,10 @@ bool doc_compare(PopplerDocument *doc1, PopplerDocument *doc2,
cairo_surface_destroy(surface_out);
}

return are_same;
if (g_verbose)
printf("%d of %d pages differ.\n", pages_differ, pages_total);

return (pages_differ > 0) || (pages1 != pages2 );
}


Expand Down

0 comments on commit f0ea560

Please sign in to comment.