]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
* Paragraph: erase unused some method and move some members to Paragraph::Private.
[lyx.git] / src / TextClass.cpp
index eb71d7380b1bd950533f8feb2cedb682e949d671..5397227b08652f5b19c5d61428801656c92c38a8 100644 (file)
 #include "support/filetools.h"
 #include "support/os.h"
 
-#include <boost/filesystem/operations.hpp>
-
 #include <sstream>
 
-namespace fs = boost::filesystem;
-
 namespace lyx {
 
 using support::FileName;
@@ -177,7 +173,7 @@ enum TextClassTags {
 // Reads a textclass structure from file.
 bool TextClass::read(FileName const & filename, ReadType rt)
 {
-       if (!support::isFileReadable(filename)) {
+       if (!filename.isFileReadable()) {
                lyxerr << "Cannot read layout file `" << filename << "'."
                       << endl;
                return true;
@@ -622,6 +618,7 @@ enum InsetLayoutTags {
        IL_LYXTYPE,
        IL_MULTIPAR,
        IL_PREAMBLE,
+       IL_VERBATIM,
        IL_END
 };
 
@@ -640,7 +637,8 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                { "latextype", IL_LATEXTYPE },
                { "lyxtype", IL_LYXTYPE },
                { "multipar", IL_MULTIPAR },
-               { "preamble", IL_PREAMBLE }
+               { "preamble", IL_PREAMBLE },
+               { "verbatim", IL_VERBATIM }
        };
 
        lexrc.pushTable(elementTags, IL_END);
@@ -656,6 +654,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
        Color::color bgcolor(Color::background);
        string preamble;
        bool multipar(false);
+       bool verbatim(false);
 
        bool getout = false;
        while (!getout && lexrc.isOK()) {
@@ -699,6 +698,10 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                        lexrc.next();
                        multipar = lexrc.getBool();
                        break;
+               case IL_VERBATIM:
+                       lexrc.next();
+                       verbatim = lexrc.getBool();
+                       break;
                case IL_FONT:
                        font.lyxRead(lexrc);
                        font.realize(defaultfont());
@@ -732,6 +735,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                il.latexname = latexname;
                il.latexparam = latexparam;
                il.multipar = multipar;
+               il.verbatim = verbatim;
                il.font = font;
                il.labelfont = labelfont;
                il.bgcolor = bgcolor;           
@@ -1014,7 +1018,7 @@ bool TextClass::load(string const & path) const
        FileName layout_file;
        if (!path.empty())
                layout_file = FileName(addName(path, name_ + ".layout"));
-       if (layout_file.empty() || !fs::exists(layout_file.toFilesystemEncoding()))
+       if (layout_file.empty() || !layout_file.exists())
                layout_file = libFileSearch("layouts", name_, "layout");
        loaded_ = const_cast<TextClass*>(this)->read(layout_file) == 0;