]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.cpp
Fix bug #4360: Instant preview does not render formulas which contain math-macro...
[features.git] / src / insets / InsetText.cpp
index 7da34f699d7ff1dae738f7fbe462a021118c902e..1d57c843a919a33e29216c14f41681f61848aa78 100644 (file)
@@ -641,16 +641,24 @@ void InsetText::appendParagraphs(ParagraphList & plist)
 }
 
 
-void InsetText::addPreview(PreviewLoader & loader) const
+void InsetText::addPreview(DocIterator const & text_inset_pos,
+       PreviewLoader & loader) const
 {
        ParagraphList::const_iterator pit = paragraphs().begin();
        ParagraphList::const_iterator pend = paragraphs().end();
+       int pidx = 0;
 
-       for (; pit != pend; ++pit) {
+       DocIterator inset_pos = text_inset_pos;
+       inset_pos.push_back(CursorSlice(*const_cast<InsetText *>(this)));
+
+       for (; pit != pend; ++pit, ++pidx) {
                InsetList::const_iterator it  = pit->insetList().begin();
                InsetList::const_iterator end = pit->insetList().end();
-               for (; it != end; ++it)
-                       it->inset->addPreview(loader);
+               inset_pos.pit() = pidx;
+               for (; it != end; ++it) {
+                       inset_pos.pos() = it->pos;
+                       it->inset->addPreview(inset_pos, loader);
+               }
        }
 }