if(!insert)\r
command.deletedAnnotations = new Hashtable();\r
\r
- int aSize, tSize;\r
+ int aSize;\r
Annotation [] temp;\r
for (int a = 0; a < annotations.length; a++)\r
{\r
\r
aSize = annotations[a].annotations.length;\r
if(insert)\r
- tSize = aSize + command.number;\r
+ temp = new Annotation[aSize + command.number];\r
else\r
- tSize = aSize - command.number;\r
-\r
- temp = new Annotation[tSize];\r
+ {\r
+ if(command.position<aSize)\r
+ temp = new Annotation[aSize - command.number + command.position];\r
+ else\r
+ temp = new Annotation[aSize];\r
+ }\r
\r
if(insert)\r
{\r
}\r
else\r
{\r
- if(command.position < annotations[a].annotations.length)\r
+ if(command.position < aSize)\r
{\r
System.arraycopy(annotations[a].annotations,\r
0, temp, 0, command.position);\r