Bug Fix [ 1766180 ] Formatted Field input Bug

This commit is contained in:
Carlos Ruiz 2007-08-06 23:27:42 +00:00
parent 778bf5cf33
commit bc96531709
1 changed files with 12 additions and 7 deletions

View File

@ -131,13 +131,18 @@ public final class MDocString extends PlainDocument implements CaretListener
throws BadLocationException
{
// Max Length
// Begin - fer_luck @ centuryon
// BugFix [ 1766180 ] Formatted Field input Bug
// // @Trifon - [ 1718897 ] User can enter more characters than max size field
// if (getLength() + string.length() > m_maxLength)
if (((String)this.getText().replace(" ", "")).length() + string.length() > m_maxLength)
return;
// End - fer_luck @ centuryon
if (m_VFormat.length() == 0) {
// non formatted strings
// // @Trifon - [ 1718897 ] User can enter more characters than max size field
if (getLength() + string.length() > m_maxLength)
return;
} else {
// Formatted strings
// globalqss - Carlos Ruiz [ 1766180 ] Formatted Field input Bug
if (offset >= m_maxLength)
return;
}
// We have no Format or inserted not manually (assuming correct Format)
if (m_VFormat.length() == 0 || string.length() != 1)
{