1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for bug#44507

This commit is contained in:
Hoda Amer 2003-10-20 21:11:44 +00:00
parent de85b5fbaa
commit 7cfb47c220
5 changed files with 24 additions and 11 deletions

View file

@ -1,3 +1,8 @@
2003-10-20 Hoda Amer
Fixed bug#44507 outline flickers with CDT1.2 RC0
Returned a boolean from IWorkingCopy.reconcile() indicating
if there was a real change.
2003-10-20 David Inglis 2003-10-20 David Inglis
fixed junit breakage - testGetSoname() fixed junit breakage - testGetSoname()
* utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java * utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java

View file

@ -118,7 +118,7 @@ public interface IWorkingCopy extends ITranslationUnit{
* The boolean argument allows to force problem detection even if the * The boolean argument allows to force problem detection even if the
* working copy is already consistent. * working copy is already consistent.
*/ */
void reconcile(boolean forceProblemDetection, IProgressMonitor monitor) throws CModelException; boolean reconcile(boolean forceProblemDetection, IProgressMonitor monitor) throws CModelException;
/** /**
* Restores the contents of this working copy to the current contents of * Restores the contents of this working copy to the current contents of
* this working copy's original element. Has no effect if this element * this working copy's original element. Has no effect if this element

View file

@ -291,13 +291,15 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/** /**
* @see org.eclipse.cdt.internal.core.model.IWorkingCopy#reconcile(boolean, org.eclipse.core.runtime.IProgressMonitor) * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#reconcile(boolean, org.eclipse.core.runtime.IProgressMonitor)
*/ */
public void reconcile(boolean forceProblemDetection, IProgressMonitor monitor) public boolean reconcile(boolean forceProblemDetection, IProgressMonitor monitor)
throws CModelException { throws CModelException {
boolean somethingChanged = false;
if (this.useCount == 0) throw newNotPresentException(); //was destroyed if (this.useCount == 0) throw newNotPresentException(); //was destroyed
if (monitor != null){ if (monitor != null){
if (monitor.isCanceled()) return; if (monitor.isCanceled()) return somethingChanged;
monitor.beginTask("element.reconciling", 10); //$NON-NLS-1$ monitor.beginTask("element.reconciling", 10); //$NON-NLS-1$
} }
@ -312,14 +314,14 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
// update the element infos with the content of the working copy // update the element infos with the content of the working copy
this.makeConsistent(monitor); this.makeConsistent(monitor);
deltaBuilder.buildDeltas(); deltaBuilder.buildDeltas();
somethingChanged = true;
} }
if (monitor != null) monitor.worked(2); if (monitor != null) monitor.worked(2);
// force problem detection? - if structure was consistent // force problem detection? - if structure was consistent
if (forceProblemDetection && wasConsistent){ if (forceProblemDetection && wasConsistent){
if (monitor != null && monitor.isCanceled()) return; if (monitor != null && monitor.isCanceled()) return somethingChanged;
//IProblemRequestor problemRequestor = this.getProblemRequestor(); //IProblemRequestor problemRequestor = this.getProblemRequestor();
//if (problemRequestor != null && problemRequestor.isActive()){ //if (problemRequestor != null && problemRequestor.isActive()){
@ -338,7 +340,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
} finally { } finally {
if (monitor != null) monitor.done(); if (monitor != null) monitor.done();
} }
return somethingChanged;
} }
/** /**
* @see org.eclipse.cdt.internal.core.model.IWorkingCopy#restore() * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#restore()

View file

@ -1,3 +1,8 @@
2003-10-20 Hoda Amer
Fixed bug#44507 outline flickers with CDT1.2 RC0
In CReconcilingStrategy, the outliner is asked to redraw only
if there was a real change.
2003-10-18 Alain Magloire 2003-10-18 Alain Magloire
New Binary Parser tab page for Cygwin PE Parser. New Binary Parser tab page for Cygwin PE Parser.

View file

@ -64,22 +64,23 @@ public class CReconcilingStrategy implements IReconcilingStrategy {
* @see IReconcilingStrategy#reconcile(dirtyRegion, region) * @see IReconcilingStrategy#reconcile(dirtyRegion, region)
*/ */
public void reconcile(DirtyRegion dirtyRegion, IRegion region) { public void reconcile(DirtyRegion dirtyRegion, IRegion region) {
// FIXME: This seems to generate to much flashing in reconcile();
// the contentouline viewer.
//reconcile();
} }
private void reconcile() { private void reconcile() {
boolean doUpdate = false;
try { try {
ITranslationUnit tu = fManager.getWorkingCopy(fEditor.getEditorInput()); ITranslationUnit tu = fManager.getWorkingCopy(fEditor.getEditorInput());
if (tu != null && tu.isWorkingCopy()) { if (tu != null && tu.isWorkingCopy()) {
IWorkingCopy workingCopy = (IWorkingCopy)tu; IWorkingCopy workingCopy = (IWorkingCopy)tu;
// reconcile // reconcile
synchronized (workingCopy) { synchronized (workingCopy) {
workingCopy.reconcile(true, fProgressMonitor); doUpdate = workingCopy.reconcile(true, fProgressMonitor);
} }
} }
fOutliner.contentUpdated(); if(doUpdate){
fOutliner.contentUpdated();
}
} catch(CModelException e) { } catch(CModelException e) {
} }