On Mon, Jan 07, 2008 at 11:08:11PM +0100, Pavel Sanda wrote: > > > Is there any chance a character counter could be implemented into Lyx? It > > > would be of great help when writing university papers > > > > > such counter is quite simple. do we want it ? > > > > Absolutely! It was reported that this is a killer feature in some fields: > > this will be only informative counter. one reason is the different views > what is to be counted, the second one and much harder to implement is > the different number of actually typesetted chars by latex. > (maybe we can give such warning in the dialog?) > > if nobody objects wrt the contrains above i will commit this later. > pavel
> diff --git a/src/BufferView.cpp b/src/BufferView.cpp > index 19e16da..d765d7f 100644 > --- a/src/BufferView.cpp > +++ b/src/BufferView.cpp > @@ -1143,24 +1143,26 @@ bool BufferView::dispatch(FuncRequest const & cmd) > from = doc_iterator_begin(buffer_.inset()); > to = doc_iterator_end(buffer_.inset()); > } > - int const count = countWords(from, to); > + pair<int, int> const count = countWords(from, to); Please use a real structuer with named items instead of a bunch on anonymous ints. It's hard to guess which is words and which is chars without looking at the actual use of the pair. Andre'