From be8fbe505d3447048d6dc8b49c67ccde1fd49a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Thu, 2 Dec 2010 04:59:54 +0000 Subject: [PATCH] PDFOptions.cpp: backport fix for #7052 to branch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@36655 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/PDFOptions.cpp | 88 +++++++++++++++++++++++----------------------- status.16x | 3 ++ 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp index 6a15d6d48d..f55f47196a 100644 --- a/src/PDFOptions.cpp +++ b/src/PDFOptions.cpp @@ -94,55 +94,55 @@ int PDFOptions::writeLaTeX(OutputParams & runparams, odocstream & os, int lines = 0; // FIXME Unicode string opt; + string hyperset; // since LyX uses unicode, also set the PDF strings to unicode strings with the // hyperref option "unicode" - opt += "unicode=true, "; - - // try to extract author and title from document when none is - // explicitely given - if (pdfusetitle && title.empty() && author.empty()) - opt += "pdfusetitle,"; - opt += "\n "; + opt += "unicode=true,"; + + // only use the hyperref settings if hyperref is enabled by the user + // see bug #7052 + if(use_hyperref) { + // try to extract author and title from document when none is + // explicitly given + if (pdfusetitle && title.empty() && author.empty()) + opt += "pdfusetitle,"; + opt += "\n "; + opt += "bookmarks=" + convert(bookmarks) + ','; + if (bookmarks) { + opt += "bookmarksnumbered=" + convert(bookmarksnumbered) + ','; + opt += "bookmarksopen=" + convert(bookmarksopen) + ','; + if (bookmarksopen) + opt += "bookmarksopenlevel=" + + convert(bookmarksopenlevel) + ','; + } + opt += "\n "; + opt += "breaklinks=" + convert(breaklinks) + ','; + opt += "pdfborder={0 0 "; + opt += (pdfborder ? '0' : '1'); + opt += "},"; + opt += "backref=" + backref + ','; + opt += "colorlinks=" + convert(colorlinks) + ','; + if (!pagemode.empty()) + opt += "pdfpagemode=" + pagemode + ','; + + // load the pdftitle etc. as hypersetup, otherwise you'll get + // LaTeX-errors when using non-latin characters + if (!title.empty()) + hyperset += "pdftitle={" + title + "},"; + if (!author.empty()) + hyperset += "\n pdfauthor={" + author + "},"; + if (!subject.empty()) + hyperset += "\n pdfsubject={" + subject + "},"; + if (!keywords.empty()) + hyperset += "\n pdfkeywords={" + keywords + "},"; + if (!quoted_options.empty()){ + hyperset += "\n "; + hyperset += quoted_options; + } + hyperset = rtrim(hyperset,","); - opt += "bookmarks=" + convert(bookmarks) + ','; - if (bookmarks) { - opt += "bookmarksnumbered=" + convert(bookmarksnumbered) + ','; - opt += "bookmarksopen=" + convert(bookmarksopen) + ','; - if (bookmarksopen) - opt += "bookmarksopenlevel=" - + convert(bookmarksopenlevel) + ','; } - opt += "\n "; - opt += "breaklinks=" + convert(breaklinks) + ','; - - opt += "pdfborder={0 0 "; - opt += (pdfborder ? '0' : '1'); - opt += "},"; - - opt += "backref=" + backref + ','; - opt += "colorlinks=" + convert(colorlinks) + ','; - if (!pagemode.empty()) - opt += "pdfpagemode=" + pagemode + ','; - - - - // load the pdftitle etc. as hypersetup, otherwise you'll get - // LaTeX-errors when using non-latin characters - string hyperset; - if (!title.empty()) - hyperset += "pdftitle={" + title + "},"; - if (!author.empty()) - hyperset += "\n pdfauthor={" + author + "},"; - if (!subject.empty()) - hyperset += "\n pdfsubject={" + subject + "},"; - if (!keywords.empty()) - hyperset += "\n pdfkeywords={" + keywords + "},"; - if (!quoted_options.empty()){ - hyperset += "\n "; - hyperset += quoted_options; - } - hyperset = rtrim(hyperset,","); // check if the hyperref settings use an encoding that exceeds // ours. If so, we have to switch to utf8. diff --git a/status.16x b/status.16x index 5095ad7049..92b22bf642 100644 --- a/status.16x +++ b/status.16x @@ -54,6 +54,9 @@ What's new - Fix DVI output of the document class "letter (lettre)". +- Do not output PDF settings if these are disabled in the document + settings (bug 7052). + * USER INTERFACE