mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
Bug fix: Adjustment for multiple reference to the same label. The solution is still not optimal as any reference to a label after the reference will not get notice. This is because addToToc() is called iteratively through the document so the toc entry for the label is still not created... any idea to fix this is welcome.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23285 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c05db366bb
commit
9b9080c0e9
@ -163,12 +163,19 @@ void InsetRef::addToToc(Buffer const & buf,
|
||||
Toc::const_iterator it = toc.begin();
|
||||
Toc::const_iterator end = toc.end();
|
||||
for (; it != end; ++it) {
|
||||
if (it->str() == label) {
|
||||
++it;
|
||||
toc.insert(it, TocItem(cpit, 1, getScreenLabel(buf)));
|
||||
if (it->str() == label)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (it == end)
|
||||
//FIXME: this is an orphan, is this really possible?
|
||||
return;
|
||||
|
||||
docstring const reflabel = getScreenLabel(buf);
|
||||
++it;
|
||||
while (it->str() == reflabel && it != end)
|
||||
++it;
|
||||
toc.insert(it, TocItem(cpit, 1, reflabel));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user