Issue 126303 - Calc: no PageCount value in DocumentStatistics
Summary: Calc: no PageCount value in DocumentStatistics
Status: UNCONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 4.1.1
Hardware: All All
: P5 (lowest) Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-12 10:30 UTC by oooforum (fr)
Modified: 2015-05-13 09:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Screenshot to show the problem (92.02 KB, image/png)
2015-05-12 10:30 UTC, oooforum (fr)
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description oooforum (fr) 2015-05-12 10:30:18 UTC
Created attachment 84735 [details]
Screenshot to show the problem

With this macro, I want to get Document statistics for a spreadsheet:
'*************************************************
Sub DocStats
	oDoc = ThisComponent
	oProps = oDoc.DocumentProperties
	aStats = oProps.DocumentStatistics
	' Loop through the array of c.s.s.beans.NamedValue
	for i = uBound(aStats) to 0 step -1
	  x = aStats(i)
	  result = result & x.Name & ": " & x.Value & chr(10)
	next
	Msgbox result
End Sub
'*************************************************

The result is different from File > Properties and Statistics tab (see screenshot).
We have an "ObjectCount" value at zero but none "PageCount".

Tested with AOO 4.1.1 and Win XP, Vista, 7 and Debian x64
Comment 1 mroe 2015-05-12 13:22:36 UTC
What is a meaningful page count for a spreadsheet?
Yes: there is no page count in oDoc.DocumentProperties.

I have a calc document with 3 sheets and without defined print ranges.

a) File::Properties...::Statistic says
Page Count: 20.

b) File::Page Preview and (Print...) shows
17 pages

The value differs because of empty areas inside the printranges.
And the values will be changed if I change the paper size or paper orientation or the scaling factors (for printing).

Pages will be created if the document is printed to something that describes a page size (screen, PDF, printer, ...). The document itself has no page size and no page count.

How many pages do you expect for a spreadsheet?
Comment 2 oooforum (fr) 2015-05-13 09:25:09 UTC
(In reply to mroe from comment #1)
> How many pages do you expect for a spreadsheet?
Properties dialog box shows this information.
And I don't know how this number is calculated.
Maybe an estimate based on basic parameters.

But the main question is how to get it through API.