Bug 43883 - Addition: StyleSheet.numStyles
Summary: Addition: StyleSheet.numStyles
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2007-11-16 05:33 UTC by Nico Verwer
Modified: 2007-11-16 07:26 UTC (History)
0 users

Adds the numStyles method to StyleSheet (604 bytes, patch)
2007-11-16 05:34 UTC, Nico Verwer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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