]> git.lyx.org Git - lyx.git/blobdiff - src/PDFOptions.cpp
use return value of regex_match to check whether a match was found
[lyx.git] / src / PDFOptions.cpp
index 7729a86ea6550604382eee2e7e07ce7e897dbc44..436e8f2e195e5de5e123cba0a288ff3f62ec0427 100644 (file)
@@ -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;
 }