]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetMarginal.cpp
fix a crash when the inset containing the new word at cursor is deleted
[lyx.git] / src / insets / InsetMarginal.cpp
index 0250d32370386674ca5bdeee3e7fb6832898f1f3..3f1aea0358d782043b7afd814f79c50781978269 100644 (file)
@@ -51,10 +51,10 @@ int InsetMarginal::docbook(odocstream & os,
 }
 
 
-void InsetMarginal::addToToc(DocIterator const & cpit)
+void InsetMarginal::addToToc(DocIterator const & cpit) const
 {
        DocIterator pit = cpit;
-       pit.push_back(CursorSlice(*this));
+       pit.push_back(CursorSlice(const_cast<InsetMarginal &>(*this)));
 
        Toc & toc = buffer().tocBackend().toc("marginalnote");
        docstring str;