When using a label in a property sheet an index out of exception is
thrown when saving/applying the information within the sheet. 

I tracked down the bug in PropertySheet.java. The problem is that the
array m_fields has a different index than the sequence decoder in
updateFieldsFromState. When a label is added in myKeyEvent in the loop
while(defDecoder.hasMoreTokens()) 
the default case does not add a field to m_fields, so positions in
defDecoder and m_fields are not synchronized any longer. 

Adding a m_fields.add(field) for the default case fixes the index out of
bounds exception. However reloading a saved game or saved module won't
work anymore, as in the while loop from above the stateDecoder is not
advanced. A "stateDecoder.nextToken();" seems to fix this as well. Patch
is attached, a test module is at 
http://tspindler.de/downtown/bin/property-test.mod

Bye,
Torsten



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/IMSolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vassalengine/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to