Project

General

Profile

« Previous | Next » 

Revision 549f7853

Added by Katja Luther almost 7 years ago

ref #6664: fix problem of not deleted objects in bulkeditor by setting offset = 1 if offset = 0

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.bulkeditor.handler;
11 11

  
12

  
12 13
import java.util.ArrayList;
13 14
import java.util.Iterator;
14 15
import java.util.List;
......
19 20
import org.eclipse.core.runtime.Status;
20 21
import org.eclipse.jface.dialogs.MessageDialog;
21 22
import org.eclipse.jface.text.TextSelection;
23
import org.eclipse.jface.text.source.Annotation;
22 24
import org.eclipse.jface.viewers.IStructuredSelection;
23 25
import org.eclipse.ui.IEditorInput;
24 26
import org.eclipse.ui.IEditorPart;
......
216 218
    						MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null);
217 219
    					}
218 220
    				}else if (model != null) {
219
                        Iterator iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
221
    					int offset = selection.getOffset();
222
    					if (offset == 0){
223
    						offset = 1;
224
    					}
225
                        Iterator iter = model.getAnnotationIterator(offset, selection.getLength(), true, true);
226
                   //     Iterator<Annotation> iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
220 227
                        while (iter.hasNext()) {
221 228
                            Object next = iter.next();
222 229
                            if (next instanceof LineAnnotation) {

Also available in: Unified diff