Bug 49690

Summary: [PATCH] create safe strings for sheet names utility class
Product: POI Reporter: maki
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: maki
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: SVN patch file, against r981695

Description maki 2010-08-02 18:16:14 UTC
Created attachment 25829 [details]
SVN patch file, against r981695

When creating or renaming sheet names within a workbook,
there are some rules to consider to avoid Exceptions.
Such rules are max. length is 31 characters or no special
characters allowed.
So nearly every one developer who allows users to enter
sheet names has to write some kind of validation code
or transforming code. Such code guarantees correct names
and avoids Exceptions.

This patch contains a new util class 
org.apache.poi.hssf.util.WorkbookUtil
which contains a method
String createSafeSheetName(final String nameProposal).

Along with some Javadoc enhancements a JUnit test is also included.
Comment 1 Nick Burch 2010-08-04 10:15:17 UTC
Thanks, applied in r982260. Applied in the ss.util rather than hssf.util package though, as it looks to be appropriate for xssf too