glib: properly document return value from poppler_font_info_scan
diff --git a/glib/demo/fonts.c b/glib/demo/fonts.c
index 00d80fb..85d28de 100644
--- a/glib/demo/fonts.c
+++ b/glib/demo/fonts.c
@@ -125,7 +125,8 @@
font_info = poppler_font_info_new(demo->doc);
- while (poppler_font_info_scan(font_info, 20, &fonts_iter)) {
+ while (scanned <= n_pages) {
+ poppler_font_info_scan(font_info, 20, &fonts_iter);
pgd_fonts_update_progress(demo, n_pages, scanned);
while (gtk_events_pending()) {
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 6cc7fdd..f0513b7 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -3148,7 +3148,10 @@
*
* <informalexample><programlisting>
* font_info = poppler_font_info_new (document);
- * while (poppler_font_info_scan (font_info, 20, &fonts_iter)) {
+ * scanned_pages = 0;
+ * while (scanned_pages <= poppler_document_get_n_pages(document)) {
+ * poppler_font_info_scan (font_info, 20, &fonts_iter);
+ * scanned_pages += 20;
* if (!fonts_iter)
* continue; /<!-- -->* No fonts found in these 20 pages *<!-- -->/
* do {
@@ -3159,7 +3162,7 @@
* }
* </programlisting></informalexample>
*
- * Returns: %TRUE, if there are more fonts left to scan
+ * Returns: %TRUE, if fonts were found
*/
gboolean poppler_font_info_scan(PopplerFontInfo *font_info, int n_pages, PopplerFontsIter **iter)
{