Am 05.10.2011 um 10:24 schrieb Jean-Marc Lasgouttes: > Le 04/10/2011 22:22, Stephan Witt a écrit : >> Am 30.09.2011 um 13:13 schrieb LyX Ticket Tracker: >> >>> #7789: Word count will count words in deleted notes (with change tracking) >>> ---------------------+------------------------------------------------------ >>> Reporter: bhelm | Owner: rgheck >>> Type: defect | Status: new >>> Priority: normal | Milestone: >>> Component: changes | Version: 2.0.Xsvn >>> Severity: normal | Keywords: patch >>> ---------------------+------------------------------------------------------ >>> Changes (by stwitt): >>> >>> * cc: stwitt (added) >>> * keywords: => patch >>> -- >>> Ticket URL:<http://www.lyx.org/trac/ticket/7789#comment:1> >> >> Does anyone has any objection? I'd like to apply the patch. > > The patch looks reasonable, provided that it works. Did you test it by hand > for the different cases?
Yes. I did test it with different cases. Bennett had the patch applied already and tested it too without negative side effects. > I would get rid of the private wordCount() and charCount() methods that are > too trivial and have only one user. I wanted to make the statistics status variables private and therefor I had to make the accessor functions. Note: there are inline code. > Actually, I do not know why this stuff goes to Buffer, and even less > Buffer::Private. We had a discussion already about the merge of the different count functions. I think these values belong to the Buffer. And to keep the Buffer constness I put it into Buffer::Private. > Is performance correct on very large files? The performance is improved - although I didn't profile it. The former implementation did iterate the document 3 times. Now there is only one iteration. I cannot imagine that's not faster. > Otherwise, such functionality could be implemented (like updateLabels) by a > Inset::updateStatistics. BUt this is a different story. I thought about that for a short time and decided to postpone this. I don't believe the statistics have to be correct all the time. It's ok to compute them when needed. Stephan