Skip to content

Commit c385278

Browse files
committed
Output number of different pages in verbose mode
1 parent 7ac6790 commit c385278

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

diff-pdf.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ bool doc_compare(PopplerDocument *doc1, PopplerDocument *doc2,
356356
wxProgressDialog *progress = NULL,
357357
Gutter *gutter = NULL)
358358
{
359-
bool are_same = true;
359+
int pages_differ = 0;
360360

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

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

456455
if ( !page_same )
457456
{
458-
are_same = false;
457+
pages_differ ++;
459458

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

478-
return are_same;
477+
if (g_verbose)
478+
printf("%d of %d pages differ.\n", pages_differ, pages_total);
479+
480+
return (pages_differ > 0) || (pages1 != pages2 );
479481
}
480482

481483

0 commit comments

Comments
 (0)