[Upstream] Word Count Characters (with spaces) incorrect with Numbering on

Bug #1001556 reported by Krzysztof Mitko on 2012-05-19
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
LibreOffice
Fix Released
Medium
libreoffice (Ubuntu)
Medium
Unassigned

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.3-0ubuntu1
  Candidate: 1:3.5.3-0ubuntu1
  Version table:
 *** 1:3.5.3-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.5.2-2ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages

3) What is expected to happen in Writer via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1001556/+attachment/3153676/+files/test.odt && lowriter --nologo test.odt

Tools -> Word Count

is the Word Count Whole document displays:
Characters (with spaces) 12

just as it does in Word 2010 https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1001556/+attachment/3153662/+files/word2010.png .

4) What happens instead is it notes 2.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libreoffice-writer 1:3.5.3-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic i686
NonfreeKernelModules: wl
ApportVersion: 2.0.1-0ubuntu7
Architecture: i386
Date: Sat May 19 10:12:16 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=pl_PL.UTF-8
 SHELL=/bin/bash
SourcePackage: libreoffice
UpgradeStatus: No upgrade log present (probably fresh install)

summary: - Word counter showing incorrent number of characters
+ Word counter showing incorrect number of characters

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libreoffice (Ubuntu):
status: New → Confirmed
cyklista (pkaplon) wrote :

I have the same problem.

  • test.odt Edit (8.9 KiB, application/vnd.oasis.opendocument.text)
description: updated

Krzysztof Mitko, thank you for taking the time to report this bug and helping to make Ubuntu better. The issue you are reporting is an upstream one and it would be nice if somebody having it could send the bug to the developers of the software by following the instructions at http://wiki.documentfoundation.org/BugReport . If you have done so, please tell us the number of the upstream bug (or the link), so we can add a bugwatch that will inform us about the status. Thanks in advance.

summary: - Word counter showing incorrect number of characters
+ Word Count Characters (with spaces) incorrect with Numbering on
Changed in libreoffice (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged

Created attachment 61877
A test document to reproduce the problem.

Problem description:

Word count shows incorrect number of characters with spaces if numbering is on.

(This is a copy of Ubuntu bug #1001556 <https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1001556> as requested there)

Steps to reproduce:
1. Open the attached file test.odt (one line saying "test test" with numbering on).
2. Tools -> Word Count

Current behavior:

Word count shows 2 characters with spaces and 10 without spaces.

Expected behavior:

Word count should show 12 characters with spaces and 10 without.

Platform (if different from the browser):

Browser: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0

Changed in df-libreoffice:
importance: Undecided → Unknown
status: New → Unknown
summary: - Word Count Characters (with spaces) incorrect with Numbering on
+ [Upstream] Word Count Characters (with spaces) incorrect with Numbering
+ on
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed

Can reproduce on LibreOffice 3.6 a1+.

Curiously, the problem goes away when one adds a second item to the numbering.

Created attachment 62850
Proposed patch.

Added a patch.

Note that if you were to test the patch using the attached test document (61877), you have to type a character first to invoke the fixed character counting code and show the correct count. The initial character count for the document is loaded from the document statistics, and is incorrect because it was calculated without the patch.

Changed in df-libreoffice:
status: Confirmed → In Progress

Muhammad Haggag committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=29ff3d49c8f0bc45a322d3ab67300bd269593181&g=libreoffice-3-6

fdo#50141: Character count (with spaces) incorrect with numbering on.

It will be available in LibreOffice 3.6.

Muhammad Haggag committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a585863f013aa4207270e11f5e031126adf1ed4a

fdo#50141: Character count (with spaces) incorrect with numbering on.

Muhammad Haggag committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fbfc736fcdf06bd2d02aac7fe83cd3080c897c27&g=libreoffice-3-5

fdo#50141: Character count (with spaces) incorrect with numbering on.

It will be available in LibreOffice 3.5.5.

interesting, that looks like a regression from 12db5315fca413ae66e88c4cd8212ee3b01667b7
"Follow UAX-29 and present user-perceived character counts".

groan...
- nTmpChars += nNumStringLen;
+ nTmpChars = pBreakIt->getGraphemeCount(aNumString);
yup.

Created attachment 63895
Screenshot after step 3

Created attachment 63896
Screenshot after step 4

Created attachment 63897
Screenshot after step 5

Hello

It seems to remain a problem in the word count in case of paragraph numbering

Steps to reproduce:

1. File> New> Text Document
2. Type "test" then apply numbering (toolbar Formatting)
3. Tools> Word count

Actual result: 1 word, character 4
Expected result: 2 words, 6 characters

see Screenshot after step 3

4. Type <Enter> then Tools> Word count

Actual result: 2 words and six characters
Expected result: 3 words, 8 characters

see Screenshot after step 4

5. Type <Enter>

Actual & Expected results: stop numbering & 6 characters and 2 words

see Screenshot after step 5

The problem seems to be the "pending" status after Step 4. If we redo <enter> (step 5) will cancel the current numbering. These are the "waiting" numbers which are not counted ... but they are there and IMHO they should be counted.

Platform: Windows 7 64bits & Version 3.6.0.0.beta3 (Build ID: 3e2b862)
Reproduced on XP (en-discuss)

Regards
Pierre-Yves

Confirmed. I'll be investigating it shortly.

Investigating the issue with comment #13 I find that its a pre-existing problem and not a regression so...

I've split this bug, and reset the original regression report back to fixed and closed the additional problem as bug 51908

We need exact and correct target information for automated lists in Wiki and LibO Web Site.

Changed in df-libreoffice:
status: In Progress → Fix Released

fix released with 3.6 on quantal

Changed in libreoffice (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.