mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
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:
parent
63de5b908f
commit
223552c65e
@ -1,5 +1,8 @@
|
||||
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.C (getTocList): change to return a map<string,
|
||||
|
42
src/buffer.C
42
src/buffer.C
@ -3702,12 +3702,46 @@ map<string, vector<Buffer::TocItem> > const Buffer::getTocList() const
|
||||
par->inset_iterator_begin();
|
||||
LyXParagraph::inset_iterator end =
|
||||
par->inset_iterator_end();
|
||||
for (; it != end; ++it) {
|
||||
if ((*it)->LyxCode() == Inset::FLOAT_CODE) {
|
||||
lyxerr << "Found a float!" << endl;
|
||||
// Now find the caption in the float...
|
||||
bool found;
|
||||
LyXTextClassList::size_type cap;
|
||||
tie(found, cap) = textclasslist
|
||||
.NumberOfLayout(params.textclass, "Caption");
|
||||
if (found) {
|
||||
for (; it != end; ++it) {
|
||||
if ((*it)->LyxCode() == Inset::FLOAT_CODE) {
|
||||
InsetFloat * il =
|
||||
static_cast<InsetFloat*>(*it);
|
||||
|
||||
//lyxerr << "Found a float!" << endl;
|
||||
string const type = il->type();
|
||||
// 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
|
||||
#ifndef NEW_INSETS
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user