https://bugs.freedesktop.org/show_bug.cgi?id=46757

Muhammad Haggag <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|[email protected] |[email protected]
                   |desktop.org                 |

--- Comment #5 from Muhammad Haggag <[email protected]> 2012-06-12 01:07:48 PDT 
---
(In reply to comment #4)
> reproduced in 3.5.3 on Fedora 64 bit
> not reproduced in 3.3.4 , therefore regression
> problem only in  Tools->Word count, no problem in File->Properties->Statistics

Are you sure file statistics aren't suffering from the same problem? It's
showing 45 for me (same as the word count dialog and status bar).

Also, when you go ahead and save the document, it updates the statistics
differently from how the word count dialog does it--it actually counts
characters marked for deletion (286), and so the word count dialog shows the
same count (since it's seeded from the document statistics). As soon as you
start typing, the word count code is invoked and the number of characters
becomes 113 again.

The problem is that character counting masks text marked as deleted and hidden
text by replacing it with spaces, but all other word/character counting code
doesn't. It seems intentional, although the "Why" isn't clear to me. See
SwTxtNode::CountWords and its call to lcl_MaskRedlinesAndHiddenText:
http://opengrok.libreoffice.org/xref/core/sw/source/core/txtnode/txtedt.cxx#1864

I tracked the change with 'git blame' to the following commit by John LeMoyne
Castle:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4bd28ba4c6d2af96bb6638b88635598e1bb88e8f

Unfortunately, the commit message doesn't explain why it's doing character
masking. A google search for "John LeMoyne Castle character count" leads to
fdo#30550: https://bugs.freedesktop.org/show_bug.cgi?id=30550

It looks like the initial work was done by Mattias Johnsson, then John fixed
several bugs. It seems the intent of his commit was to fix the selection case
only. It might be that the character masking bit was erroneously added, perhaps
a left over from another commit.

My recommendation is to remove the masking of deleted characters, since it'll
be  a lot of work to get that working properly (and consistently) with both
word/character count and document statistics, for no obvious benefit. If
there's demand for such a feature, it should be filed and tracked separately.

I'll be posting a patch shortly to remove the masking and make the behavior
consistent.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to