gcc compile fix: vector::insert() requires an iterator, not a const_iterator.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26642 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-09-30 12:34:36 +00:00
parent f40a74eae2
commit b54b51c694
3 changed files with 6 additions and 5 deletions

View File

@ -413,7 +413,7 @@ void Changes::addToToc(DocIterator const & cdit, Buffer const & buffer) const
dit.pos() = it->range.start;
str += " " + dit.paragraph().asString(it->range.start, it->range.end);
docstring const & author = author_list.get(it->change.author).name();
Toc::const_iterator it = change_list.item(0, author);
Toc::iterator it = change_list.item(0, author);
if (it == change_list.end()) {
change_list.push_back(TocItem(dit, 0, author));
change_list.push_back(TocItem(dit, 1, str));

View File

@ -203,12 +203,12 @@ TocIterator Toc::item(DocIterator const & dit) const
}
TocIterator Toc::item(int depth, docstring const & str) const
Toc::iterator Toc::item(int depth, docstring const & str)
{
if (empty())
return end();
TocIterator it = begin();
TocIterator itend = end();
iterator it = begin();
iterator itend = end();
for (; it != itend; ++it) {
if (it->depth() == depth && it->str() == str)
break;

View File

@ -75,11 +75,12 @@ class Toc : public std::vector<TocItem>
{
public:
typedef std::vector<TocItem>::const_iterator const_iterator;
typedef std::vector<TocItem>::iterator iterator;
const_iterator item(DocIterator const & dit) const;
/// Look for a TocItem given its depth and string.
/// \return The first matching item.
/// \retval end() if no item was found.
const_iterator item(int depth, docstring const & str) const;
iterator item(int depth, docstring const & str);
};
typedef Toc::const_iterator TocIterator;