X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FPDFOptions.cpp;h=436e8f2e195e5de5e123cba0a288ff3f62ec0427;hb=1e190a2af27ca99831f51567c16e6b39bf4317c3;hp=7729a86ea6550604382eee2e7e07ce7e897dbc44;hpb=8b83daaef0ce23926c47c1a15252e692ded18297;p=lyx.git diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp index 7729a86ea6..436e8f2e19 100644 --- a/src/PDFOptions.cpp +++ b/src/PDFOptions.cpp @@ -89,10 +89,9 @@ void PDFOptions::writeFile(ostream & os) const } -int PDFOptions::writeLaTeX(OutputParams & runparams, odocstream & os, +void PDFOptions::writeLaTeX(OutputParams & runparams, otexstream & os, bool hyperref_already_provided) const { - int lines = 0; // FIXME Unicode string opt; string hyperset; @@ -174,25 +173,22 @@ int PDFOptions::writeLaTeX(OutputParams & runparams, odocstream & os, opt = "\\hypersetup{" + opt + hyperset + "}\n"; } - lines = int(count(opt.begin(), opt.end(), '\n')); - // hyperref expects utf8! - if (need_unicode && enc && enc->iconvName() != "UTF-8") { + if (need_unicode && enc && enc->iconvName() != "UTF-8" + &&!runparams.isFullUnicode()) { os << "\\inputencoding{utf8}\n" << setEncoding("UTF-8"); - ++lines; } - // if hyperref is loaded by the document class and hyperset is empty, - // nothing must be output, see bug #7048 + // FIXME: handle the case that hyperref is loaded by the document class and + // hyperset is empty, see bug #7048 if (!(hyperref_already_provided && hyperset.empty())) os << from_utf8(opt); - if (need_unicode && enc && enc->iconvName() != "UTF-8") { + if (need_unicode && enc && enc->iconvName() != "UTF-8" + &&!runparams.isFullUnicode()) { os << setEncoding(enc->iconvName()) << "\\inputencoding{" << from_ascii(enc->latexName()) << "}\n"; - ++lines; } - return lines; }