]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
Fix bug 2474; partial fix for 1777. Added last_reference_ member to QRef class and...
[lyx.git] / src / bufferparams.C
index f7d659c906528cdfd489d9cffe655d50baae36c9..16e787321c11e9de275714e031156fdf2d5a8e0b 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"
@@ -436,8 +435,12 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                // the layout file will be correctly loaded later.
                if (!getLyXTextClass().isTeXClassAvailable()) {
                        docstring const msg =
-                               bformat(_("The document uses a missing "
-                                                      "TeX class \"%1$s\".\n"), from_utf8(classname));
+                               bformat(_("The layout file requested by this document,\n"
+                                                "%1$s.layout,\n"
+                                                "is not usable. This is probably because a LaTeX\n"
+                                                "class or style file required by it is not\n"
+                                                "available. See the Customization documentation\n"
+                                                "for more information.\n"), from_utf8(classname));
                        Alert::warning(_("Document class not available"),
                                       msg + _("LyX will not be able to produce output."));
                }
@@ -958,19 +961,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 +1491,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_;