mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug Fixing
This commit is contained in:
parent
1b4fc963a7
commit
e7bd887fae
3 changed files with 26 additions and 24 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2004-06-09 Hoda Amer
|
||||||
|
Fix for PR 62656 : [Saving] a cpp file after copying/renaming a function in front of a constructor locks Eclipse
|
||||||
|
|
||||||
2004-06-09 David Inglis
|
2004-06-09 David Inglis
|
||||||
|
|
||||||
added new ICDescriptor manager method to get a descriptor with the option of creating
|
added new ICDescriptor manager method to get a descriptor with the option of creating
|
||||||
|
|
|
@ -83,6 +83,15 @@ public interface ICElementDelta {
|
||||||
*/
|
*/
|
||||||
public int F_MOVED_TO = 0x0020;
|
public int F_MOVED_TO = 0x0020;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change flag indicating that the element has changed position relatively to its siblings.
|
||||||
|
* If the element is an <code>IPackageFragmentRoot</code>, a classpath entry corresponding
|
||||||
|
* to the element has changed position in the project's classpath.
|
||||||
|
*
|
||||||
|
* @since 2.1
|
||||||
|
*/
|
||||||
|
public int F_REORDER = 0x00100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change flag indicating that the underlying <code>IProject</code> has been
|
* Change flag indicating that the underlying <code>IProject</code> has been
|
||||||
* opened.
|
* opened.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
package org.eclipse.cdt.internal.core.model;
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Copyright (c) 2002,2003 Rational Software Corporation and others.
|
* Copyright (c) 2002,2003 Rational Software Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
@ -9,6 +8,7 @@ package org.eclipse.cdt.internal.core.model;
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Rational Software - Initial API and implementation
|
* Rational Software - Initial API and implementation
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.internal.core.model;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -175,8 +175,7 @@ private void findChangesInPositioning(ICElement element, int depth) throws CMode
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!isPositionedCorrectly(element)) {
|
if (!isPositionedCorrectly(element)) {
|
||||||
this.delta.removed(element);
|
this.delta.changed(element, ICElementDelta.F_REORDER);
|
||||||
this.delta.added(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element instanceof IParent) {
|
if (element instanceof IParent) {
|
||||||
|
@ -287,28 +286,19 @@ private boolean isIdentical(CElement e1, CElement e2) {
|
||||||
*/
|
*/
|
||||||
private boolean isPositionedCorrectly(ICElement element) {
|
private boolean isPositionedCorrectly(ICElement element) {
|
||||||
ListItem oldListItem = this.getOldPosition(element);
|
ListItem oldListItem = this.getOldPosition(element);
|
||||||
if (oldListItem == null)
|
if (oldListItem == null) return false;
|
||||||
return false;
|
|
||||||
ICElement oldPrevious = oldListItem.previous;
|
|
||||||
ListItem newListItem = this.getNewPosition(element);
|
ListItem newListItem = this.getNewPosition(element);
|
||||||
if (newListItem == null)
|
if (newListItem == null) return false;
|
||||||
return false;
|
|
||||||
ICElement newPrevious = newListItem.previous;
|
ICElement oldPrevious = oldListItem.previous;
|
||||||
if (oldPrevious == newPrevious)
|
ICElement newPrevious = newListItem.previous;
|
||||||
return true;
|
|
||||||
ICElement lastNewPrevious = null;
|
if (oldPrevious == null) {
|
||||||
while(lastNewPrevious != newPrevious) {
|
return newPrevious == null;
|
||||||
if (isIdentical((CElement)oldPrevious, (CElement)newPrevious))
|
} else {
|
||||||
return true;
|
return oldPrevious.equals(newPrevious);
|
||||||
ICElement tempLastPrevious = lastNewPrevious; //JOHNC added this
|
}
|
||||||
lastNewPrevious = newPrevious;
|
|
||||||
// if newPrevious is null at this time we should exit the loop.
|
|
||||||
if (newPrevious == null) break;
|
|
||||||
ICElement tempPrevious = (this.getNewPosition(newPrevious)).previous; //JOHNC added this
|
|
||||||
if( tempLastPrevious == tempPrevious ) break; // JOHNC added this
|
|
||||||
newPrevious = tempPrevious;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
private void putElementInfo(ICElement element, CElementInfo info) {
|
private void putElementInfo(ICElement element, CElementInfo info) {
|
||||||
this.infos.put(element, info);
|
this.infos.put(element, info);
|
||||||
|
|
Loading…
Add table
Reference in a new issue