[ 1718897 ] User can enter more characters than max size field
This commit is contained in:
trifonnt 2007-05-14 20:12:53 +00:00
parent 6f27400bb8
commit 408aa4abe3
1 changed files with 3 additions and 2 deletions

View File

@ -130,7 +130,8 @@ public final class MDocString extends PlainDocument implements CaretListener
throws BadLocationException
{
// Max Length
if (offset >= m_maxLength)
// // @Trifon - [ 1718897 ] User can enter more characters than max size field
if (getLength() + string.length() > m_maxLength)
return;
// We have no Format or inserted not manually (assuming correct Format)
if (m_VFormat.length() == 0 || string.length() != 1)
@ -141,7 +142,7 @@ public final class MDocString extends PlainDocument implements CaretListener
}
/** Formating required **/
log.finest("Offsret=" + offset
log.finest("Offset=" + offset
+ ", String=" + string + ", MaxLength=" + m_maxLength
+ ", Format=" + m_VFormat + ", Mask=" + m_mask
+ ", Text=" + getText() + ", Length=" + getText().length());