]> 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 09bd79652a906447091e27dade3561c8d10ab4a4..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,27 +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"
            &&!runparams.isFullUnicode()) {
                os << "\\inputencoding{utf8}\n"
                   << setEncoding("UTF-8");
-               ++lines;
        }
        // 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 (!(hyperref_already_provided && hyperset.empty()))
+               os << from_utf8(opt);
 
        if (need_unicode && enc && enc->iconvName() != "UTF-8"
            &&!runparams.isFullUnicode()) {
                os << setEncoding(enc->iconvName())
                   << "\\inputencoding{" << from_ascii(enc->latexName()) << "}\n";
-               ++lines;
        }
-       return lines;
 }