PDF Output: Fix add ToC option not being used

PDF Output: Fix Table of Contents being added tot he end of the PDF even
without the Add Table of Contents option being enabled. Fixes #1194836 [When convert to PDF, it always create TOC at the end](https://bugs.launchpad.net/calibre/+bug/1194836)
This commit is contained in:
Kovid Goyal 2013-06-26 16:55:12 +05:30
parent 63d133ea5c
commit f63f142618

View File

@ -253,7 +253,7 @@ class PDFWriter(QObject):
return self.loop.exit(1) return self.loop.exit(1)
try: try:
if not self.render_queue: if not self.render_queue:
if self.toc is not None and len(self.toc) > 0 and not hasattr(self, 'rendered_inline_toc'): if self.opts.pdf_add_toc and self.toc is not None and len(self.toc) > 0 and not hasattr(self, 'rendered_inline_toc'):
return self.render_inline_toc() return self.render_inline_toc()
self.loop.exit() self.loop.exit()
else: else: