]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
* Painter.h:
[lyx.git] / src / bufferparams.C
index 973ef55f98efaba7d4818e9c98ebd87e2cc857d6..1af925829e9eb59f279a7c58dab23f7b347b9842 100644 (file)
@@ -727,10 +727,10 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        }
 
        // custom, A3, B3 and B4 paper sizes need geometry
-       bool nonstandard_papersize = (papersize == PAPER_B3) ||
-                                    (papersize == PAPER_B4) ||
-                                    (papersize == PAPER_A3) ||
-                                    (papersize == PAPER_CUSTOM);
+       bool nonstandard_papersize = papersize == PAPER_B3 
+               || papersize == PAPER_B4
+               || papersize == PAPER_A3
+               || papersize == PAPER_CUSTOM;
 
        if (!use_geometry) {
                switch (papersize) {
@@ -835,32 +835,26 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                texrow.newline();
        }
 
-       // TODO: Some people want to support more encodings than UTF-8. They can have a field day around here
-       if (true) {
-               os << "\\usepackage[utf8]{inputenc}\n";
+       if (inputenc == "auto") {
+               string const doc_encoding =
+                       language->encoding()->latexName();
+
+               // Create a list with all the input encodings used
+               // in the document
+               std::set<string> encodings =
+                       features.getEncodingSet(doc_encoding);
+
+               os << "\\usepackage[";
+               std::set<string>::const_iterator it = encodings.begin();
+               std::set<string>::const_iterator const end = encodings.end();
+               for (; it != end; ++it)
+                       os << from_ascii(*it) << ',';
+               os << from_ascii(doc_encoding) << "]{inputenc}\n";
+               texrow.newline();
+       } else if (inputenc != "default") {
+               os << "\\usepackage[" << from_ascii(inputenc)
+                  << "]{inputenc}\n";
                texrow.newline();
-       } else {
-               if (inputenc == "auto") {
-                       string const doc_encoding =
-                               language->encoding()->latexName();
-
-                       // Create a list with all the input encodings used
-                       // in the document
-                       std::set<string> encodings =
-                               features.getEncodingSet(doc_encoding);
-
-                       os << "\\usepackage[";
-                       std::set<string>::const_iterator it = encodings.begin();
-                       std::set<string>::const_iterator const end = encodings.end();
-                       for (; it != end; ++it)
-                               os << from_ascii(*it) << ',';
-                       os << from_ascii(doc_encoding) << "]{inputenc}\n";
-                       texrow.newline();
-               } else if (inputenc != "default") {
-                       os << "\\usepackage[" << from_ascii(inputenc)
-                          << "]{inputenc}\n";
-                       texrow.newline();
-               }
        }
 
        if (use_geometry || nonstandard_papersize) {
@@ -993,7 +987,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                        break;
                case VSpace::LENGTH:
                        os << "\\setlength\\parskip{"
-                          << from_ascii(getDefSkip().length().asLatexString())
+                          << from_utf8(getDefSkip().length().asLatexString())
                           << "}\n";
                        break;
                default: // should never happen // Then delete it.