mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
2004-09-02 Alain Magloire
Deal with WorkingCopy vs TranslationUnit in the hashCode. * src/org/eclipse/cdt/internal/ui/cview/CViewElementComparer.java
This commit is contained in:
parent
5737282b4c
commit
69ecf16572
2 changed files with 11 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-09-02 Alain Magloire
|
||||
|
||||
Deal with WorkingCopy vs TranslationUnit in the hashCode.
|
||||
* src/org/eclipse/cdt/internal/ui/cview/CViewElementComparer.java
|
||||
|
||||
2004-09-02 Bogdan Gheorghe
|
||||
Fix for 72816: [Search] Selection Search For Working Set
|
||||
|
||||
|
|
|
@ -58,15 +58,13 @@ public class CViewElementComparer implements IElementComparer {
|
|||
ICElement c1= (o1 instanceof ICElement) ? (ICElement)o1 : null;
|
||||
if (c1 == null)
|
||||
return o1.hashCode();
|
||||
if (c1 instanceof ITranslationUnit) {
|
||||
ITranslationUnit t1= (ITranslationUnit)c1;
|
||||
if (t1.isWorkingCopy()) {
|
||||
c1= ((IWorkingCopy)t1).getOriginalElement();
|
||||
}
|
||||
}
|
||||
if (c1 == null) {
|
||||
ITranslationUnit u1= (ITranslationUnit)c1.getAncestor(ICElement.C_UNIT);
|
||||
if (u1 == null || !u1.isWorkingCopy())
|
||||
return o1.hashCode();
|
||||
}
|
||||
// From here on c1 is a working copy.
|
||||
c1= ((IWorkingCopy)u1).getOriginal(c1);
|
||||
if (c1 == null)
|
||||
return o1.hashCode();
|
||||
return c1.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue