Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Commit

Permalink
Do not include covers in the outline and toc
Browse files Browse the repository at this point in the history
  • Loading branch information
antialize committed Sep 28, 2010
1 parent 18aa67f commit 39cd4a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/lib/pdfconverter.cc
Expand Up @@ -283,11 +283,14 @@ void PdfConverterPrivate::pagesLoaded(bool ok) {

painter->save();
QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
obj.pageCount = objects[d].settings.pagesCount? wp.pageCount(): 0;
pageCount += objects[d].pageCount;
obj.pageCount = obj.settings.pagesCount? wp.pageCount(): 0;
pageCount += obj.pageCount;

outline->addWebPage(obj.page->mainFrame()->title(), wp, obj.page->mainFrame(),
obj.settings, obj.localLinks, obj.anchors);
if (obj.settings.includeInOutline)
outline->addWebPage(obj.page->mainFrame()->title(), wp, obj.page->mainFrame(),
obj.settings, obj.localLinks, obj.anchors);
else
outline->addEmptyWebPage();
painter->restore();
}

Expand Down
4 changes: 3 additions & 1 deletion src/pdf/pdfarguments.cc
Expand Up @@ -244,6 +244,9 @@ PdfCommandLineParser::PdfCommandLineParser(PdfGlobal & s, QList<PdfObject> & ps)

extended(true);
qthack(true);
addarg("include-in-outline", 0, "Include the page in the table of contents and outlines", new ConstSetter<bool>(od.includeInOutline, true));
addarg("exclude-from-outline", 0, "Do not include the page in the table of contents and outlines", new ConstSetter<bool>(od.includeInOutline, false));

addarg("disable-smart-shrinking", 0, "Disable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant",new ConstSetter<bool>(od.web.enableIntelligentShrinking, false));
addarg("enable-smart-shrinking", 0, "Enable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant",new ConstSetter<bool>(od.web.enableIntelligentShrinking, true));

Expand All @@ -263,7 +266,6 @@ PdfCommandLineParser::PdfCommandLineParser(PdfGlobal & s, QList<PdfObject> & ps)
addarg("disable-toc-back-links",0,"Do not link from section header to toc", new ConstSetter<bool>(od.toc.backLinks,false));

addPageLoadArgs(od.load);

// addarg("page-offset",0,"Set the starting page number", new IntSetter(s.pageOffset,"offset",1));


Expand Down
2 changes: 1 addition & 1 deletion src/shared/commandlineparserbase.cc
Expand Up @@ -23,7 +23,7 @@
#include <qwebframe.h>

bool ahsort(const ArgHandler * a, const ArgHandler * b) {
QRegExp e("^(no|enable|disable)-");
QRegExp e("^(no|enable|disable|include-in|exclude-from)-");
QString x=a->longName;
QString y=b->longName;
x.remove(e);
Expand Down

0 comments on commit 39cd4a6

Please sign in to comment.