]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetwrap.C
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetwrap.C
index 4c48a7c38d72d028b0ffac258f9242b8611f8df0..8bfec5a9101658d183d5e54b79297deff67ccdf5 100644 (file)
@@ -28,7 +28,7 @@
 #include "lyxlex.h"
 #include "outputparams.h"
 #include "paragraph.h"
-#include "pariterator.h"
+#include "TocBackend.h"
 
 #include "support/convert.h"
 
@@ -180,7 +180,7 @@ docstring const InsetWrap::editMessage() const
 
 
 int InsetWrap::latex(Buffer const & buf, odocstream & os,
-                    OutputParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        os << "\\begin{floating" << from_ascii(params_.type) << '}';
        if (!params_.placement.empty())
@@ -192,8 +192,19 @@ int InsetWrap::latex(Buffer const & buf, odocstream & os,
 }
 
 
+int InsetWrap::plaintext(Buffer const & buf, odocstream & os,
+                         OutputParams const & runparams) const
+{
+       os << '[' << _("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n";
+       InsetText::plaintext(buf, os, runparams);
+       os << "\n]";
+
+       return PLAINTEXT_NEWLINE + 1; // one char on a separate line
+}
+
+
 int InsetWrap::docbook(Buffer const & buf, odocstream & os,
-                      OutputParams const & runparams) const
+                       OutputParams const & runparams) const
 {
         // FIXME UNICODE
         os << '<' << from_ascii(params_.type) << '>';
@@ -224,22 +235,10 @@ bool InsetWrap::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetWrap::addToToc(TocBackend::TocList & toclist, Buffer const & buf) const
+void InsetWrap::addToToc(TocList & toclist, Buffer const & buf) const
 {
-       ParConstIterator pit = par_const_iterator_begin(*this);
-       ParConstIterator end = par_const_iterator_end(*this);
-
-       // Find a caption layout in one of the (child inset's) pars
-       for (; pit != end; ++pit) {
-               if (pit->layout()->labeltype == LABEL_SENSITIVE) {
-                       string const type = params_.type;
-                       docstring const str =
-                               convert<docstring>(toclist[type].size() + 1)
-                               + ". " + pit->asString(buf, false);
-                       TocBackend::Item const item(pit, 0, str);
-                       toclist[type].push_back(item);
-               }
-       }
+       // Is there a need to provide a list of wrap insets?
+       return;
 }