Bug 49690 - [PATCH] create safe strings for sheet names utility class
Summary: [PATCH] create safe strings for sheet names utility class
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2010-08-02 18:16 UTC by maki
Modified: 2010-08-04 10:15 UTC (History)
1 user (show)

SVN patch file, against r981695 (8.76 KB, patch)
2010-08-02 18:16 UTC, maki
Details | Diff

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