]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
GuiWrap: make the optional options really optional by checkboxes in the dialog
[lyx.git] / src / BufferParams.cpp
index 785e54d2d5e432c86f7736ec3e8e27a3ed2f55ef..839dac9d983264986e60c1114dd3171fa947c04b 100644 (file)
@@ -439,6 +439,7 @@ Spacing const & BufferParams::spacing() const
        return pimpl_->spacing;
 }
 
+
 PDFOptions & BufferParams::pdfoptions()
 {
        return pimpl_->pdfoptions;
@@ -450,6 +451,7 @@ PDFOptions const & BufferParams::pdfoptions() const
        return pimpl_->pdfoptions;
 }
 
+
 VSpace const & BufferParams::getDefSkip() const
 {
        return pimpl_->defskip;
@@ -649,8 +651,7 @@ string const BufferParams::readToken(Lexer & lex, string const & token)
                lex >> float_placement;
 
        } else if (prefixIs(token, "\\pdf_") || token == "\\use_hyperref") {
-               string toktmp;
-               toktmp = pdfoptions().readToken(lex, token);
+               string toktmp = pdfoptions().readToken(lex, token);
                if (!toktmp.empty()) {
                        lyxerr << "PDFOptions::readToken(): Unknown token: " <<
                                toktmp << endl;
@@ -1119,6 +1120,15 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // The optional packages;
        docstring lyxpreamble(from_ascii(features.getPackages()));
 
+       // PDF support. Hyperref manual: "Make sure it comes last of your loaded
+       // packages, to give it a fighting chance of not being over-written,
+       // since its job is to redefine many LATEX commands."
+       // Has to be put into lyxpreamble (preserving line-counting for error
+       // parsing).
+       odocstringstream oss;
+       pdfoptions().writeLaTeX(oss);
+       lyxpreamble += oss.str();
+
        // this might be useful...
        lyxpreamble += "\n\\makeatletter\n";
 
@@ -1191,15 +1201,6 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                lyxpreamble += from_utf8(features.getBabelOptions());
        }
 
-       // PDF support. Hypreref manual: "Make sure it comes last of your loaded
-       // packages, to give it a fighting chance of not being over-written,
-       // since its job is to redefine many LATEX commands."
-       // Has to be put into lyxpreamble (preserving line-counting for error
-       // parsing).
-       odocstringstream oss;
-       pdfoptions().writeLaTeX(oss);
-       lyxpreamble += oss.str();
-
        lyxpreamble += "\\makeatother\n\n";
 
        int const nlines =