]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
Fix loop when opening TOC widget in an empty document, basically by Richard Heck.
[lyx.git] / src / bufferparams.C
index f7d659c906528cdfd489d9cffe655d50baae36c9..2bdcf37fb4faaf696a988cb4fdc08029c97a5c4d 100644 (file)
@@ -37,7 +37,6 @@
 #include "vspace.h"
 
 #include "frontends/Alert.h"
-#include "frontends/controllers/biblio.h"
 
 #include "support/lyxalgo.h" // for lyx::count
 #include "support/convert.h"
@@ -958,19 +957,19 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
                        }
                }
                if (!topmargin.empty())
-                       os << ",tmargin=" << from_ascii(topmargin);
+                       os << ",tmargin=" << from_ascii(LyXLength(topmargin).asLatexString());
                if (!bottommargin.empty())
-                       os << ",bmargin=" << from_ascii(bottommargin);
+                       os << ",bmargin=" << from_ascii(LyXLength(bottommargin).asLatexString());
                if (!leftmargin.empty())
-                       os << ",lmargin=" << from_ascii(leftmargin);
+                       os << ",lmargin=" << from_ascii(LyXLength(leftmargin).asLatexString());
                if (!rightmargin.empty())
-                       os << ",rmargin=" << from_ascii(rightmargin);
+                       os << ",rmargin=" << from_ascii(LyXLength(rightmargin).asLatexString());
                if (!headheight.empty())
-                       os << ",headheight=" << from_ascii(headheight);
+                       os << ",headheight=" << from_ascii(LyXLength(headheight).asLatexString());
                if (!headsep.empty())
-                       os << ",headsep=" << from_ascii(headsep);
+                       os << ",headsep=" << from_ascii(LyXLength(headsep).asLatexString());
                if (!footskip.empty())
-                       os << ",footskip=" << from_ascii(footskip);
+                       os << ",footskip=" << from_ascii(LyXLength(footskip).asLatexString());
                os << "}\n";
                texrow.newline();
        }
@@ -1488,7 +1487,7 @@ biblio::CiteEngine BufferParams::getEngine() const
 {
        // FIXME the class should provide the numerical/
        // authoryear choice
-       if (getLyXTextClass().provides(LyXTextClass::natbib)
+       if (getLyXTextClass().provides("natbib")
            && cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
                return biblio::ENGINE_NATBIB_AUTHORYEAR;
        return cite_engine_;