From e2cd79482becdd45183221b96436e8b91439dc90 Mon Sep 17 00:00:00 2001 From: Igor Slepchin Date: Mon, 13 Feb 2012 15:51:54 -0500 Subject: [PATCH 2/2] Consistently check if pdftohtml needs to generate outlines. --- utils/HtmlOutputDev.cc | 6 +----- utils/pdftohtml.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc index 0640f51..2fbcc97 100644 --- a/utils/HtmlOutputDev.cc +++ b/utils/HtmlOutputDev.cc @@ -1566,11 +1566,7 @@ GBool HtmlOutputDev::dumpDocOutline(PDFDoc* doc) if (!ok) return gFalse; - Outline *outline = doc->getOutline(); - if (!outline) - return gFalse; - - GooList *outlines = outline->getItems(); + GooList *outlines = doc->getOutline()->getItems(); if (!outlines) return gFalse; diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc index fce2b7b..8475a0b 100644 --- a/utils/pdftohtml.cc +++ b/utils/pdftohtml.cc @@ -46,6 +46,7 @@ #include "XRef.h" #include "Catalog.h" #include "Page.h" +#include "Outline.h" #include "PDFDoc.h" #include "PDFDocFactory.h" #include "HtmlOutputDev.h" @@ -182,6 +183,7 @@ int main(int argc, char *argv[]) { SplashOutputDev *splashOut = NULL; #endif PSOutputDev *psOut = NULL; + GBool doOutline; GBool ok; char *p; GooString *ownerPW, *userPW; @@ -370,6 +372,11 @@ int main(int argc, char *argv[]) { else rawOrder = singleHtml; +#ifdef DISABLE_OUTLINE + doOutline = gFalse; +#else + doOutline = doc->getOutline()->getItems() != NULL; +#endif // write text file htmlOut = new HtmlOutputDev(htmlFileName->getCString(), docTitle->getCString(), @@ -380,7 +387,7 @@ int main(int argc, char *argv[]) { extension, rawOrder, firstPage, - doc->getCatalog()->getOutline()->isDict()); + doOutline); delete docTitle; if( author ) { -- 1.7.7.6