]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetMarginal.cpp
Fix layout bug. Pasting text into a cell tried to set Standard layout, because
[lyx.git] / src / insets / InsetMarginal.cpp
index 654caca709859b87c5f8e9e8bd789c8f08f9af23..9a21a89a788d14207ad85569f2ab7dd2e6b8e754 100644 (file)
 #include "InsetMarginal.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "OutputParams.h"
 #include "TocBackend.h"
 
+#include "support/docstream.h"
 #include "support/gettext.h"
 
-#include <ostream>
-
-
 namespace lyx {
 
 
@@ -67,15 +66,17 @@ int InsetMarginal::docbook(odocstream & os,
 }
 
 
-void InsetMarginal::addToToc(ParConstIterator const & cpit) const
+void InsetMarginal::addToToc(DocIterator const & cpit)
 {
-       ParConstIterator pit = cpit;
-       pit.push_back(*this);
+       DocIterator pit = cpit;
+       pit.push_back(CursorSlice(*this));
 
        Toc & toc = buffer().tocBackend().toc("marginalnote");
        docstring str;
        str = getNewLabel(str);
        toc.push_back(TocItem(pit, 0, str));
+       // Proceed with the rest of the inset.
+       InsetFootlike::addToToc(cpit);
 }
 
 } // namespace lyx