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)
BTW, this is OK with OOo dev300m106.
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.]
Added keyword "regression" because it works well with LibreOffice 3.3.2 (release) OOO330m19 (Build:202) tag libreoffice-3.3.2.2 [on WinXP]
One for cedric?
Created attachment 47405 [details] Fields broken and not broken
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.
Created attachment 49051 [details] This patch seems to fix this - I've sent it for review to the mailin list.
Fixed in libreoffice-3-4 branch, hopefully it will get enough approvals for 3.4.2 as well.
will be in 3.4.2.