]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetWrap.cpp
Improve handling of top and bottom margin
[lyx.git] / src / insets / InsetWrap.cpp
index 00223ad532d8667c52b6c24fbd7e015358bcf183..b05d5dba4790bf9634652b2992d10814259176a7 100644 (file)
@@ -26,7 +26,8 @@
 #include "FuncStatus.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
-#include "output_xhtml.h"
+#include "xml.h"
+#include "texstream.h"
 #include "TextClass.h"
 
 #include "support/debug.h"
@@ -126,9 +127,9 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetWrap::updateBuffer(ParIterator const & it, UpdateType utype)
+void InsetWrap::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted)
 {
-       InsetCaptionable::updateBuffer(it, utype);
+       InsetCaptionable::updateBuffer(it, utype, deleted);
 }
 
 
@@ -206,27 +207,27 @@ int InsetWrap::plaintext(odocstringstream & os,
 }
 
 
-int InsetWrap::docbook(odocstream & os, OutputParams const & runparams) const
+void InsetWrap::docbook(XMLStream & xs, OutputParams const & runparams) const
 {
-       // FIXME UNICODE
-       os << '<' << from_ascii(params_.type) << '>';
-       int const i = InsetText::docbook(os, runparams);
-       os << "</" << from_ascii(params_.type) << '>';
-       return i;
+       InsetLayout const & il = getLayout();
+
+       xs << xml::StartTag(il.docbooktag(), il.docbookattr()); // TODO: Detect when there is a title.
+       InsetText::docbook(xs, runparams);
+       xs << xml::EndTag(il.docbooktag());
 }
 
 
-docstring InsetWrap::xhtml(XHTMLStream & xs, OutputParams const & rp) const
+docstring InsetWrap::xhtml(XMLStream & xs, OutputParams const & rp) const
 {
        string const len = params_.width.asHTMLString();
        string const width = len.empty() ? "50%" : len;
        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 = 
+       xs << xml::StartTag(tag, attr);
+       docstring const deferred =
                InsetText::insetAsXHTML(xs, rp, InsetText::WriteInnerTag);
-       xs << html::EndTag(tag);
+       xs << xml::EndTag(tag);
        return deferred;
 }