]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
add missing writeNormal() methods to some insets
[lyx.git] / src / bufferparams.C
index 157b69fe550f1dfdb6e351eaeb0ddd70b70ff9a6..958800c69ec873d923ddb8a339e1603339fff646 100644 (file)
@@ -89,8 +89,9 @@ void BufferParams::writeFile(ostream & os) const
        }
    
        /* then the text parameters */
-       os << "\\language " << language->lang()
-          << "\n\\inputencoding " << inputenc
+       if (language != ignore_language)
+               os << "\\language " << language->lang() << '\n';
+       os << "\\inputencoding " << inputenc
           << "\n\\fontscheme " << fonts
           << "\n\\graphics " << graphicsDriver << '\n';
 
@@ -176,7 +177,8 @@ void BufferParams::writeFile(ostream & os) const
 }
 
 
-void BufferParams::useClassDefaults() {
+void BufferParams::useClassDefaults()
+{
        LyXTextClass const & tclass = textclasslist.TextClass(textclass);
 
        sides = tclass.sides();
@@ -188,9 +190,22 @@ void BufferParams::useClassDefaults() {
 }
 
 
+bool BufferParams::hasClassDefaults() const
+{
+       LyXTextClass const & tclass = textclasslist.TextClass(textclass);
+       
+       return (sides == tclass.sides()
+               && columns == tclass.columns()
+               && pagestyle == tclass.pagestyle()
+               && options == tclass.options()
+               && secnumdepth == tclass.secnumdepth()
+               && tocdepth == tclass.tocdepth());
+}
+
+
 void BufferParams::readPreamble(LyXLex & lex)
 {
-       if (lex.GetString() != "\\begin_preamble")
+       if (lex.getString() != "\\begin_preamble")
                lyxerr << "Error (BufferParams::readPreamble):"
                        "consistency check failed." << endl;
 
@@ -202,7 +217,7 @@ void BufferParams::readLanguage(LyXLex & lex)
 {
        if (!lex.next()) return;
        
-       string const tmptok = lex.GetString();
+       string const tmptok = lex.getString();
 
        // check if tmptok is part of tex_babel in tex-defs.h
        language = languages.getLanguage(tmptok);
@@ -220,7 +235,7 @@ void BufferParams::readGraphicsDriver(LyXLex & lex)
 {
        if (!lex.next()) return;
        
-       string const tmptok = lex.GetString();
+       string const tmptok = lex.getString();
        // check if tmptok is part of tex_graphics in tex_defs.h
        int n = 0;
        while (true) {