]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
Safer temp file creation with regards to double slash.
[lyx.git] / src / TextClass.cpp
index 69f40e9b79d3a3ee62f41c5a3dc3c4cda452f72c..2e5087f31389aefaa168b586115868d09589c3ff 100644 (file)
@@ -245,7 +245,7 @@ bool TextClass::read(FileName const & filename, ReadType rt)
        // we do this before loading any layout file, so that classes can 
        // override features of this layout if they should choose to do so.
        if (rt == BASECLASS && !hasLayout(emptylayout_))
-               layoutlist_.push_back(createDefaultLayout(emptylayout_));
+               layoutlist_.push_back(createEmptyLayout(emptylayout_));
 
        Lexer lexrc(textClassTags);
        lexrc.setFile(filename);
@@ -903,13 +903,6 @@ bool TextClass::hasLayout(docstring const & n) const
 }
 
 
-void TextClass::addLayoutIfNeeded(docstring const & n) const
-{
-       if (!hasLayout(n))
-               layoutlist_.push_back(createDefaultLayout(n, true));
-}
-
-
 Layout const & TextClass::operator[](docstring const & name) const
 {
        LASSERT(!name.empty(), /**/);
@@ -995,8 +988,17 @@ bool TextClass::load(string const & path) const
 }
 
 
+void DocumentClass::addLayoutIfNeeded(docstring const & n) const
+{
+       if (!hasLayout(n))
+               layoutlist_.push_back(createEmptyLayout(n, true));
+}
+
+
 InsetLayout const & DocumentClass::insetLayout(docstring const & name) const 
 {
+       // FIXME The fix for the InsetLayout part of 4812 would be here:
+       // Add the InsetLayout to the document class if it is not found.
        docstring n = name;
        InsetLayouts::const_iterator cen = insetlayoutlist_.end();
        while (!n.empty()) {
@@ -1037,7 +1039,7 @@ bool TextClass::isPlainLayout(Layout const & layout) const
 }
 
 
-Layout TextClass::createDefaultLayout(docstring const & name, bool unknown) const
+Layout TextClass::createEmptyLayout(docstring const & name, bool unknown) const
 {
        static Layout * defaultLayout = NULL;