Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2010-07-21 05:53:35 -0400
committerAnton Leherbauer2010-07-21 05:53:35 -0400
commitb2d03c49ea16b9c314bc4802a3af43e179e74502 (patch)
tree179234440bbb23fcb878b7e58e37b303fa955751
parent8b068f8b8f01b98a6ba70ddbf30507762175fcf9 (diff)
downloadorg.eclipse.cdt-b2d03c49ea16b9c314bc4802a3af43e179e74502.tar.gz
org.eclipse.cdt-b2d03c49ea16b9c314bc4802a3af43e179e74502.tar.xz
org.eclipse.cdt-b2d03c49ea16b9c314bc4802a3af43e179e74502.zip
Bug 296014 - 'Add new expression' can end up in the middle of Expression list
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java
index d6c779ef28..cedb2417b9 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Wind River Systems and others.
+ * Copyright (c) 2007, 2010 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -155,7 +155,10 @@ public class ExpressionVMProviderModelProxyStrategy extends DefaultVMModelProxyS
{
switch (event.getType()) {
case ADDED:
- parentDelta.addNode(element, -1, IModelDelta.ADDED);
+ // New expressions are always added one element before last.
+ // Last element is the "Add new expression" element.
+ int parentCount = parentDelta.getChildCount();
+ parentDelta.addNode(element, parentCount > 1 ? parentCount - 2 : -1, IModelDelta.ADDED);
break;
case CHANGED:
parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.CONTENT);

Back to the top