]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetBox.cpp
index 287af6efabcdcada5804b9415518dc9c6ed06b75..1300533feeac126c4655aa4e7b249c4e864b31e7 100644 (file)
@@ -27,6 +27,7 @@
 #include "TextClass.h"
 
 #include "support/debug.h"
+#include "support/docstream.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/Translator.h"
@@ -212,7 +213,7 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
                        params_.type = cmd.getArg(1);
                else
                        string2params(to_utf8(cmd.argument()), params_);
-               setLayout(cur.buffer().params());
+               setLayout();
                break;
        }
 
@@ -484,6 +485,27 @@ int InsetBox::docbook(odocstream & os, OutputParams const & runparams) const
 }
 
 
+docstring InsetBox::xhtml(odocstream &, OutputParams const & runparams) const
+{
+       string style;
+       if (!params_.width.empty())
+               style += ("width: " + params_.width.asHTMLString() + ";");
+       if (!params_.height.empty())
+               style += ("height: " + params_.height.asHTMLString() + ";");
+       
+       docstring retval = from_ascii("<div class='" + params_.type + "'");
+       if (!style.empty())
+               retval += from_ascii(" style='" + style + "'");
+       retval += ">\n";
+       odocstringstream os;
+       docstring defer = InsetText::xhtml(os, runparams);
+       retval += os.str();
+       retval += "</div>\n";
+       retval += defer + "\n";
+       return retval;
+}
+
+
 void InsetBox::validate(LaTeXFeatures & features) const
 {
        BoxType btype = boxtranslator().find(params_.type);
@@ -508,7 +530,7 @@ void InsetBox::validate(LaTeXFeatures & features) const
                features.require("framed");
                break;
        }
-       InsetText::validate(features);
+       InsetCollapsable::validate(features);
 }