|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2003, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2003, 2010 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 212-217
Link Here
|
| 212 |
} |
212 |
} |
| 213 |
|
213 |
|
| 214 |
private void addAttributeOperation(IDocumentAttributeNode attr, ArrayList ops, IModelChangedEvent event) { |
214 |
private void addAttributeOperation(IDocumentAttributeNode attr, ArrayList ops, IModelChangedEvent event) { |
|
|
215 |
|
| 215 |
int offset = attr.getValueOffset(); |
216 |
int offset = attr.getValueOffset(); |
| 216 |
Object newValue = event.getNewValue(); |
217 |
Object newValue = event.getNewValue(); |
| 217 |
Object changedObject = attr; |
218 |
Object changedObject = attr; |
|
Lines 221-227
Link Here
|
| 221 |
int length = attr.getValueOffset() + attr.getValueLength() + 1 - attr.getNameOffset(); |
222 |
int length = attr.getValueOffset() + attr.getValueLength() + 1 - attr.getNameOffset(); |
| 222 |
op = getAttributeDeleteEditOperation(attr.getNameOffset(), length); |
223 |
op = getAttributeDeleteEditOperation(attr.getNameOffset(), length); |
| 223 |
} else { |
224 |
} else { |
| 224 |
op = new ReplaceEdit(offset, attr.getValueLength(), getWritableAttributeNodeValue(event.getNewValue().toString())); |
225 |
op = new ReplaceEdit(offset, event.getOldValue().toString().length()/* attr.getValueLength()*/, getWritableAttributeNodeValue(event.getNewValue().toString())); |
| 225 |
} |
226 |
} |
| 226 |
} |
227 |
} |
| 227 |
|
228 |
|