You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/07/28 23:55:00 UTC

[Bug 56781] New: XSSFName.validateName(String) Only Checks for the First Character's Validity and Presence of Spaces

https://issues.apache.org/bugzilla/show_bug.cgi?id=56781

            Bug ID: 56781
           Summary: XSSFName.validateName(String) Only Checks for the
                    First Character's Validity and Presence of Spaces
           Product: POI
           Version: 3.9
          Hardware: PC
                OS: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: romeara@live.com

XSSFName.validateName(String) (and HSSFName.validateName(String)) each validate
name input for named ranged (when set via "setNameName(String)'). This
validation only checks that the first character is an underscore or letter, and
that there are no spaces in the name. 

This does not prevent other invalid characters (such as '-') from being used
within the body of the name. Upon opening the file in Excel 2010, excel claims
there is corrupted data and attempts repair (which consists of removing the
offending named range(s), after which the file is readable without issue)

Both of these validation methods should check the full length of the name for
invalid characters. 

There is a forum post in the excel forums with someone asking what the valid
useable chracters are. The most relevant response was:

"From Excel Help:

What characters are allowed? The first character of a name must be a letter, an
underscore character (_), or a backslash (\).
Remaining characters in the name can be letters, numbers, periods, and
underscore characters."

There are additional restrictions documented in the javadoc of
HSSFName.setNameName and XSSFName.setNameName, such as maximum length.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 56781] XSSFName.validateName(String) Only Checks for the First Character's Validity and Presence of Spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56781

--- Comment #2 from Nick Burch <ap...@gagravarr.org> ---
http://poi.apache.org/howtobuild.html and http://poi.apache.org/guidelines.html
should hopefully cover you on getting started to contribute

FormulaParser currently has logic for deciding if a sequence of characters is a
valid (anything) for a formula, my first hunch is it might be possible to
perhaps re-use the name validating parts of that?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 56781] XSSFName.validateName(String) Only Checks for the First Character's Validity and Presence of Spaces

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56781

--- Comment #1 from Ryan O'Meara <ro...@live.com> ---
Side note: If I manage to get the POI environment setup, I'd be willing to take
a crack at a patch for this

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org