]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetInclude.cpp
Use new rowFlags() values to remove some inset hardcoding.
[features.git] / src / insets / InsetInclude.cpp
index be823a77d56e243f7092fa31fe9de4b640c108af..87d2e5103d0dd913d5df419807fe1b93fa7fcf10 100644 (file)
@@ -65,8 +65,6 @@
 #include "support/mutex.h"
 #include "support/ExceptionMessage.h"
 
-#include "support/bind.h"
-
 using namespace std;
 using namespace lyx::support;
 
@@ -446,12 +444,6 @@ docstring InsetInclude::screenLabel() const
 }
 
 
-Buffer * InsetInclude::getChildBuffer() const
-{
-       return loadIfNeeded();
-}
-
-
 Buffer * InsetInclude::loadIfNeeded() const
 {
        // This is for background export and preview. We don't even want to
@@ -945,7 +937,7 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
 }
 
 
-docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
+docstring InsetInclude::xhtml(XMLStream & xs, OutputParams const & rp) const
 {
        if (rp.inComment)
                 return docstring();
@@ -955,11 +947,11 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
        bool const listing = isListings(params());
        if (listing || isVerbatim(params())) {
                if (listing)
-                       xs << html::StartTag("pre");
+                       xs << xml::StartTag("pre");
                // FIXME: We don't know the encoding of the file, default to UTF-8.
                xs << includedFileName(buffer(), params()).fileContents("UTF-8");
                if (listing)
-                       xs << html::EndTag("pre");
+                       xs << xml::EndTag("pre");
                return docstring();
        }
 
@@ -996,10 +988,10 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const
                op.par_end = 0;
                ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::IncludedFile);
        } else
-               xs << XHTMLStream::ESCAPE_NONE
+               xs << XMLStream::ESCAPE_NONE
                   << "<!-- Included file: "
                   << from_utf8(included_file.absFileName())
-                  << XHTMLStream::ESCAPE_NONE
+                  << XMLStream::ESCAPE_NONE
                         << " -->";
        
        return docstring();
@@ -1232,9 +1224,9 @@ string InsetInclude::contextMenuName() const
 }
 
 
-Inset::DisplayType InsetInclude::display() const
+Inset::RowFlags InsetInclude::rowFlags() const
 {
-       return type(params()) == INPUT ? Inline : AlignCenter;
+       return type(params()) == INPUT ? Inline : Display;
 }
 
 
@@ -1330,7 +1322,7 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active,
                b.pushItem(cpit, screenLabel(), output_active);
                b.pop();
        } else {
-               Buffer const * const childbuffer = getChildBuffer();
+               Buffer const * const childbuffer = loadIfNeeded();
 
                TocBuilder & b = backend.builder("child");
                docstring str = childbuffer ? childbuffer->fileName().displayName()
@@ -1386,7 +1378,7 @@ void InsetInclude::updateCommand()
 void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
        file_exist_ = includedFileExist();
-       Buffer const * const childbuffer = getChildBuffer();
+       Buffer const * const childbuffer = loadIfNeeded();
        if (childbuffer) {
                if (!checkForRecursiveInclude(childbuffer))
                        childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype);