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