Bug 43883

Summary: Addition: StyleSheet.numStyles
Product: POI Reporter: Nico Verwer <nverwer>
Component: HWPFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Adds the numStyles method to StyleSheet

Description Nico Verwer 2007-11-16 05:33:20 UTC
It is convenient if org.apache.poi.hwpf.model.StyleSheet can tell how many
styles it contains. For this, I made a numStyles method:

  /**
   * Gets the number of styles in the style sheet.
   * @return The number of styles in the style sheet.
   */
  public int numStyles() {
    return _styleDescriptions.length;
  }

This can be used, for example, to list all styles in a document.
I use this in a Cocoon generator which gives an somewhat complete XML version of
a Word document. This generator will be released as an open source component.
Comment 1 Nico Verwer 2007-11-16 05:34:21 UTC
Created attachment 21138 [details]
Adds the numStyles method to StyleSheet

A patch that adds the method has been attached.
Comment 2 Nick Burch 2007-11-16 07:26:14 UTC
Committed, thanks