]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetWrap.cpp
Let the Foot inset have a different Layout when inside a title
[lyx.git] / src / insets / InsetWrap.cpp
index c40f7005b7727275781a5b77ce6a3fe37c5a887e..181474a889feb3f7ed5e49795f9005805f7123bb 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "frontends/Application.h"
 
+#include <climits>
+
 using namespace std;
 
 
@@ -58,7 +60,7 @@ InsetWrap::~InsetWrap()
 }
 
 
-docstring InsetWrap::name() const
+docstring InsetWrap::layoutName() const
 {
        return "Wrap:" + from_utf8(params_.type);
 }
@@ -201,11 +203,12 @@ void InsetWrap::latex(otexstream & os, OutputParams const & runparams_in) const
 }
 
 
-int InsetWrap::plaintext(odocstream & os, OutputParams const & runparams) const
+int InsetWrap::plaintext(odocstringstream & os,
+        OutputParams const & runparams, size_t max_length) const
 {
        os << '[' << buffer().B_("wrap") << ' '
                << floatName(params_.type) << ":\n";
-       InsetText::plaintext(os, runparams);
+       InsetText::plaintext(os, runparams, max_length);
        os << "\n]";
 
        return PLAINTEXT_NEWLINE + 1; // one char on a separate line
@@ -226,12 +229,13 @@ docstring InsetWrap::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 {
        string const len = params_.width.asHTMLString();
        string const width = len.empty() ? "50%" : len;
-       string const attr = "class='wrap' style='width: " + len + ";'";
-       xs << html::StartTag("div", attr);
+       InsetLayout const & il = getLayout();
+       string const tag = il.htmltag();
+       string const attr = il.htmlattr() + " style='width:" + width + ";'";
+       xs << html::StartTag(tag, attr);
        docstring const deferred = 
                InsetText::insetAsXHTML(xs, rp, InsetText::WriteInnerTag);
-       if (!len.empty())
-               xs << html::EndTag("div");
+       xs << html::EndTag(tag);
        return deferred;
 }