Created attachment 62923 Proposed patch. After looking at the code closely, I change my recommendation. It's actually straight-forward to get the word counting code to consistently ignore deleted content. Patch attached.
One problem that remains with this patch is document statistics. When you save the document, a gross word count is computed (including deleted content), saved with the document, and seeded to the word count dialog. The word count dialog (and status bar) show the incorrect count until you edit the document (insert/delete something), at which point the proper word counting logic is invoked and the count is corrected. I won't post the patch for review/commit yet in the hopes that I can fix the document statistics issue as well. If it looks complicated, I'll get this committed and pursue the statistics issue separately. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to libreoffice in Ubuntu. https://bugs.launchpad.net/bugs/981033 Title: [Upstream] Words and Character excluding spaces Word Count incorrect with Record Changes enabled Status in LibreOffice Productivity Suite: In Progress Status in “libreoffice” package in Ubuntu: Triaged Bug description: 1) lsb_release -rd Description: Ubuntu 12.04 LTS Release: 12.04 2) apt-cache policy libreoffice-writer libreoffice-writer: Installed: 1:3.5.2-2ubuntu1 Candidate: 1:3.5.2-2ubuntu1 Version table: *** 1:3.5.2-2ubuntu1 0 500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages 100 /var/lib/dpkg/status 3) What is expect to happen in Writer in a blank document is paste the following text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus eu ligula et arcu dapibus viverra ac ut elit. Proin rhoncus sapien et velit cursus ac molestie justo malesuada. Aliquam pretium, orci nec malesuada laoreet, nisl nisi tristique dui, vitae rutrum ipsum libero sit amet nunc. Activate record changes via Edit -> Changes -> Record, highlight everything from: Proin until: nunc. delete it, and the Word Count shows as it does in Word 2010 screenshot: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/981033/+attachment/3134188/+files/word2010.png 4) What happens instead is it shows: Words: 45 Characters: 113 Characters excluding spaces: 245 ProblemType: Bug DistroRelease: Ubuntu 12.04 Package: libreoffice-calc 1:3.5.1-1ubuntu4 ProcVersionSignature: Ubuntu 3.2.0-21.34-generic-pae 3.2.13 Uname: Linux 3.2.0-21-generic-pae i686 ApportVersion: 2.0-0ubuntu4 Architecture: i386 Date: Fri Apr 13 14:22:48 2012 InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha i386 (20120222) ProcEnviron: TERM=xterm PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: libreoffice UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/df-libreoffice/+bug/981033/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp