Bug 36816 - Document statistics: Paragraph Count doesn't work
Summary: Document statistics: Paragraph Count doesn't work
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.0 Beta3
Hardware: Other All
: medium major
Assignee: Jan Holesovsky
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: mab3.4
  Show dependency treegraph
 
Reported: 2011-05-03 13:47 UTC by clio
Modified: 2011-07-18 08:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Fields broken and not broken (9.22 KB, application/vnd.oasis.opendocument.text)
2011-05-31 10:40 UTC, LeMoyne Castle
Details
This patch seems to fix this - I've sent it for review to the mailin list. (1.15 KB, patch)
2011-07-13 11:40 UTC, Jan Holesovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description clio 2011-05-03 13:47:33 UTC
To reproduce:
1) Open Writer
2) Insert a few non-empty paragraphs.
3a) Either Go to menu File - Properties - Statistics
3b) Or go to menu Insert - Fields - Other - Statistics - Paragraphs
3c) Or go to menu Insert - Fields - Other - Variables - Insert Formula (type "PARA" w/o the quotes and press Insert button.

Result: Zero paragraphs.

(tested with http://dev-builds.libreoffice.org/daily/Linux_x86_Release_Configuration/libreoffice-3-4/2011-05-03_07:07:13/ on Ubuntu 10.04)
Comment 1 clio 2011-05-03 14:20:43 UTC
BTW, this is OK with OOo dev300m106.
Comment 2 manj_k 2011-05-04 12:03:44 UTC
Tested with LibO 3.4 Beta3 (release) on WinXP,
and I can confirm "zero paragraphs" for the steps 3a, 3b, 3c.

After closing and reopening a test case document:
You can temporarily get the number of paragraphs for the fields (3b and 3c)
via Tools > Update > Fields (or <F9>).
But the next update--after having added a new paragraph--will reset the fields to zero again.

[... and yes, works fine with OOo-dev DEV300m106.]
Comment 3 manj_k 2011-05-04 12:30:53 UTC
Added keyword "regression"
because it works well with 
LibreOffice 3.3.2 (release)
OOO330m19 (Build:202)
tag libreoffice-3.3.2.2
[on WinXP]
Comment 4 Muthu 2011-05-05 00:46:59 UTC
One for cedric?
Comment 5 LeMoyne Castle 2011-05-31 10:40:01 UTC
Created attachment 47405 [details]
Fields broken and not broken
Comment 6 LeMoyne Castle 2011-05-31 10:44:11 UTC
Testing in a recent dev master (pull and build 28 May) shows the counts displayed in fields *sometimes* go to zero when the Word Count dialog is opened.  

After insert/append of a new paragraph (empty or not) the fields are updated correctly. Upon selecting Tools->Word Count the fields go to zero and stay there.  But with further insert of fields after Save (from toolbar button), the newer fields update correctly through Tools->Word Count, Update->Fields and Update->All (after changing text in odt).

When damaged, the fields always show zero with a tool tip of zero (healthy fields show no tooltip?).  When View-Field Names [ctrl-F9] is chosen, all relevant fields show Statistics as their name. I also inserted and deleted other fields (date, time, page number) and perhaps that straightened out the Statistics fields, maybe it was the Save.  I could not reproduce the on again off again behavior described in Comment #2.  It appears that the fields are incomplete (or damaged by Word Count) but only in certain circumstances that require more testing to ferret out.  

Attached 36816 test.odt that shows both damaged and healthy fields.
Comment 7 Jan Holesovsky 2011-07-13 11:40:37 UTC
Created attachment 49051 [details]
This patch seems to fix this - I've sent it for review to the mailin list.
Comment 8 Jan Holesovsky 2011-07-14 03:42:18 UTC
Fixed in libreoffice-3-4 branch, hopefully it will get enough approvals for 3.4.2 as well.
Comment 9 Michael Meeks 2011-07-18 08:34:20 UTC
will be in 3.4.2.