[EMAIL PROTECTED] wrote: > Author: younes > Date: Tue Sep 30 13:06:34 2008 > New Revision: 26639 > > URL: http://www.lyx.org/trac/changeset/26639 > Log: > Add a "List of Changes" in the Navigator. The list is updated only when the > document structure is reset or when the update button is clicked. Some work > is needed to track more finely individual changes as we do for sections.
... > +void Changes::addToToc(DocIterator const & cdit, Buffer const & buffer) const > +{ > + if (table_.empty()) > + return; > + > + Toc & change_list = buffer.tocBackend().toc("change"); > + AuthorList const & author_list = buffer.params().authors(); > + DocIterator dit = cdit; > + > + ChangeTable::const_iterator it = table_.begin(); > + ChangeTable::const_iterator const itend = table_.end(); > + for (; it != itend; ++it) { > + docstring str; > + switch (it->change.type) { > + case Change::UNCHANGED: > + continue; > + case Change::DELETED: > + // 0x2702 is a scissors symbol in the Dingbats unicode > group. > + str.push_back(0x2702); > + break; > + case Change::INSERTED: > + // 0x2702 is the hand writting symbol in the Dingbats > unicode group. > + str.push_back(0x270d); > + break; > + } > + 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); > + if (it == change_list.end()) { > + change_list.push_back(TocItem(dit, 0, author)); > + change_list.push_back(TocItem(dit, 1, str)); > + } else { > + it++; > + change_list.insert(it, TocItem(dit, 1, str)); > + } > + } my gcc doesnt like this. make[4]: Entering directory `/mnt/teral/lyx/devel/src' /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../boost -Wextra -Wall -O2 -MT Changes.lo -MD -MP -MF .deps/Changes.Tpo -c -o Changes.lo Changes.cpp g++ -DHAVE_CONFIG_H -I. -I.. -I../src -I../boost -Wextra -Wall -O2 -MT Changes.lo -MD -MP -MF .deps/Changes.Tpo -c Changes.cpp -o Changes.o Changes.cpp: In member function 'void lyx::Changes::addToToc(const lyx::DocIterator&, const lyx::Buffer&) const': Changes.cpp:426: error: no matching function for call to 'lyx::Toc::insert(__gnu_cxx::__normal_iterator<const lyx::TocItem*, std::vector<lyx::TocItem, std::allocator<lyx::TocItem> > >&, lyx::TocItem)' /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/vector.tcc:93: note: candidates are: typename std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = lyx::TocItem, _Alloc = std::allocator<lyx::TocItem>] /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_vector.h:657: note: void std::vector<_Tp, _Alloc>::insert(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, size_t, const _Tp&) [with _Tp = lyx::TocItem, _Alloc = std::allocator<lyx::TocItem>] make[4]: *** [Changes.lo] Error 1 pavel