gen toc also when NEW_INSETS is defined

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1733 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-03-11 20:04:33 +00:00
parent 63de5b908f
commit 223552c65e
2 changed files with 41 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2001-03-11 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com> 2001-03-11 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
* buffer.C (getTocList): make the list also when NEW_INSETS is
defined.
* buffer.h: remove TocType * buffer.h: remove TocType
* buffer.C (getTocList): change to return a map<string, * buffer.C (getTocList): change to return a map<string,

View File

@ -3702,12 +3702,46 @@ map<string, vector<Buffer::TocItem> > const Buffer::getTocList() const
par->inset_iterator_begin(); par->inset_iterator_begin();
LyXParagraph::inset_iterator end = LyXParagraph::inset_iterator end =
par->inset_iterator_end(); par->inset_iterator_end();
bool found;
LyXTextClassList::size_type cap;
tie(found, cap) = textclasslist
.NumberOfLayout(params.textclass, "Caption");
if (found) {
for (; it != end; ++it) { for (; it != end; ++it) {
if ((*it)->LyxCode() == Inset::FLOAT_CODE) { if ((*it)->LyxCode() == Inset::FLOAT_CODE) {
lyxerr << "Found a float!" << endl; InsetFloat * il =
static_cast<InsetFloat*>(*it);
//lyxerr << "Found a float!" << endl;
string const type = il->type();
// Now find the caption in the float... // Now find the caption in the float...
// We now tranverse the paragraphs of
// the inset...
LyXParagraph * tmp = il->inset->par;
while (tmp) {
if (tmp->layout == cap) {
TocItem ti;
ti.par = tmp;
ti.depth = 0;
ti.str = tmp->String(this, false);
map<string, vector<TocItem> >::iterator it = l.find(type);
if (it == l.end()) {
vector<TocItem> vti;
vti.push_back(ti);
l[type] = vti;
} else {
it->second.push_back(ti);
} }
} }
tmp = tmp->next();
}
}
}
} else {
lyxerr << "caption not found" << endl;
}
#endif #endif
#ifndef NEW_INSETS #ifndef NEW_INSETS
} }