]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Fix bug #4360: Instant preview does not render formulas which contain math-macro...
[lyx.git] / src / insets / InsetTabular.cpp
index 9b0abc9690dd2f0ca0941f64170925bdfcdb47e2..e149c1d810aa13e05074bdf0c238ed8c2542aab2 100644 (file)
@@ -5289,13 +5289,19 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
 }
 
 
-void InsetTabular::addPreview(PreviewLoader & loader) const
+void InsetTabular::addPreview(DocIterator const & inset_pos,
+       PreviewLoader & loader) const
 {
        row_type const rows = tabular.row_info.size();
        col_type const columns = tabular.column_info.size();
+       DocIterator cell_pos = inset_pos;
+
+       cell_pos.push_back(CursorSlice(*const_cast<InsetTabular *>(this)));
        for (row_type i = 0; i < rows; ++i) {
-               for (col_type j = 0; j < columns; ++j)
-                       tabular.cellInset(i, j)->addPreview(loader);
+               for (col_type j = 0; j < columns; ++j) {
+                       cell_pos.top().idx() = index(i, j);
+                       tabular.cellInset(i, j)->addPreview(cell_pos, loader);
+               }
        }
 }