diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 6050ae6bfe..b75d552a6f 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ +2002-08-02 Angus Leeming + + * insetcollapsable.[Ch] (addPreview): + * insettabular.[Ch] (addPreview): + * insettext.[Ch] (addPreview): new methods. Can now generate previews + for insets in insets. + 2002-08-02 Angus Leeming * insetcite.C: fix typo. diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 0f2cde6ade..de8e98f740 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -676,3 +676,9 @@ string const InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv, first_after_edit = false; return str; } + + +void InsetCollapsable::addPreview(grfx::PreviewLoader & loader) const +{ + inset.addPreview(loader); +} diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index a86e00df5b..b9fca1d3d3 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -190,6 +190,9 @@ public: bool searchBackward(BufferView * bv, string const & str, bool = true, bool = false); + /// + void addPreview(grfx::PreviewLoader &) const; + protected: /// int ascent_collapsed() const; diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 3c43db7997..f88e9dbb83 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -2917,3 +2917,15 @@ bool InsetTabular::insertAsciiString(BufferView * bv, string const & buf, return true; } + + +void InsetTabular::addPreview(grfx::PreviewLoader & loader) const +{ + int const rows = tabular->rows(); + int const columns = tabular->columns(); + for (int i = 0; i < rows; ++i) { + for (int j = 0; j < columns; ++j) { + tabular->GetCellInset(i,j)->addPreview(loader); + } + } +} diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index f6e5257587..298790526c 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -229,6 +229,9 @@ public: // "normal" means without width set! bool forceDefaultParagraphs(Inset const * in) const; + /// + void addPreview(grfx::PreviewLoader &) const; + // // Public structures and variables /// diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 5496568320..c3b93db510 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -2797,3 +2797,18 @@ void InsetText::appendParagraphs(BufferParams const & bparams, reinitLyXText(); } + + +void InsetText::addPreview(grfx::PreviewLoader & loader) const +{ + Paragraph * par = getFirstParagraph(0); + while (par) { + Paragraph::inset_iterator it = par->inset_iterator_begin(); + Paragraph::inset_iterator end = par->inset_iterator_end(); + for (; it != end; ++it) { + it->addPreview(loader); + } + + par = par->next(); + } +} diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 9f0fe2dc94..eaeba72355 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -248,6 +248,8 @@ public: /// void appendParagraphs(BufferParams const & bparams, Paragraph *); /// + void addPreview(grfx::PreviewLoader &) const; + // // Public structures and variables ///