https://bz.apache.org/bugzilla/show_bug.cgi?id=64788
Bug ID: 64788
Summary: Text validation in createPromptBox doesn't read
_x000a_ line break as one caracter
Product: POI
Version: 4.1.2-FINAL
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Currently a data validation occuring in createPromptBox on the prompt text is
checking whether text is longuer than 255 omiting the fact that line break
entities are transcoded as _x000a_ text and thus failing the test while in
reality _x000a_ is seens as 1 caracter by excel.
As a solution you may check length on a string wich is obtained by replacing
_x000a_ or _x000a_ and _x000d_ as a dummy character before testing its length
against the 255 caracters limit :
if(text != null && text.length() > 255) {
throw new IllegalStateException("Prompt-text cannot be
longer than 255 characters, but had: " + text);
}
===>
if(text != null && text.replace("_x000a_","_").replace("_x000d_","_").length()
> 255) {
throw new IllegalStateException("Prompt-text cannot be
longer than 255 characters, but had: " + text);
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]