Now generate previews when loading the buffer for insets in insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4847 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-02 16:39:43 +00:00
parent cc132995fa
commit 5f46df1f0f
7 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2002-08-02 Angus Leeming <leeming@lyx.org>
* insetcollapsable.[Ch] (addPreview):
* insettabular.[Ch] (addPreview):
* insettext.[Ch] (addPreview): new methods. Can now generate previews
for insets in insets.
2002-08-02 Angus Leeming <leeming@lyx.org>
* insetcite.C: fix typo.

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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
///

View File

@ -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();
}
}

View File

@ -248,6 +248,8 @@ public:
///
void appendParagraphs(BufferParams const & bparams, Paragraph *);
///
void addPreview(grfx::PreviewLoader &) const;
//
// Public structures and variables
///