Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied - fix for bug#44507 Outline Flickers with CDT1.2 RC0


Alain,
I hope this solves the problem. I made sure that re-drawing occurs only if there was a real change in the document.

Core :
        Returned a boolean from IWorkingCopy.reconcile() indicating
        if there was a real change.
UI:
        In CReconcilingStrategy, the outliner is asked to redraw only
        if there was a real change.



Hoda Amer
Staff Software Engineer
Rational Software - IBM Software Group





"Alain Magloire" <alain@xxxxxxx>
Sent by: cdt-patch-admin@xxxxxxxxxxx

10/20/2003 01:49 PM
Please respond to cdt-patch

       
        To:        cdt-patch@xxxxxxxxxxx
        cc:        
        Subject:        Re: [cdt-patch] Solution to bug#43524  : Removing a define from a .c file



>
> Alain,
> I have a solution to this problem.
> The previous handling ignored reconciling in some cases, which was not
> correct.
> Actually, you get a reconcile for every region once, but the redraw draws
> the whole thing.
> The proper thing to do is to redraw only if  we have a real change.
> Give me until tomorrow and I will submit the solution.
>

Of course!! no stress.

Thanks for looking at this.


_______________________________________________
cdt-patch mailing list
cdt-patch@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-patch

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.166
diff -u -r1.166 ChangeLog
--- ChangeLog	20 Oct 2003 18:10:44 -0000	1.166
+++ ChangeLog	20 Oct 2003 21:05:20 -0000
@@ -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
 	fixed junit breakage - testGetSoname()    
 	* utils/org/eclipse/cdt/utils/elf/parser/BinaryShared.java
Index: model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java,v
retrieving revision 1.2
diff -u -r1.2 IWorkingCopy.java
--- model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java	27 Mar 2003 16:05:18 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/IWorkingCopy.java	20 Oct 2003 21:05:21 -0000
@@ -118,7 +118,7 @@
 	 * The boolean argument allows to force problem detection even if the
 	 * 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
 	 * this working copy's original element. Has no effect if this element
Index: model/org/eclipse/cdt/internal/core/model/WorkingCopy.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java,v
retrieving revision 1.2
diff -u -r1.2 WorkingCopy.java
--- model/org/eclipse/cdt/internal/core/model/WorkingCopy.java	27 Mar 2003 16:05:18 -0000	1.2
+++ model/org/eclipse/cdt/internal/core/model/WorkingCopy.java	20 Oct 2003 21:05:22 -0000
@@ -291,13 +291,15 @@
 	/**
 	 * @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 {
 			
+		boolean somethingChanged = false;
+		
 		if (this.useCount == 0) throw newNotPresentException(); //was destroyed
 
 		if (monitor != null){
-			if (monitor.isCanceled()) return;
+			if (monitor.isCanceled()) return somethingChanged;
 			monitor.beginTask("element.reconciling", 10); //$NON-NLS-1$
 		}
 
@@ -312,14 +314,14 @@
 				// update the element infos with the content of the working copy
 				this.makeConsistent(monitor);
 				deltaBuilder.buildDeltas();
-
+				somethingChanged = true;
 			}
 
 			if (monitor != null) monitor.worked(2);
 	
 			// force problem detection? - if structure was consistent
 			if (forceProblemDetection && wasConsistent){
-				if (monitor != null && monitor.isCanceled()) return;
+				if (monitor != null && monitor.isCanceled()) return somethingChanged;
 
 				//IProblemRequestor problemRequestor = this.getProblemRequestor();
 				//if (problemRequestor != null && problemRequestor.isActive()){
@@ -338,7 +340,7 @@
 		} finally {
 			if (monitor != null) monitor.done();
 		}
-			
+		return somethingChanged;	
 	}
 	/**
 	 * @see org.eclipse.cdt.internal.core.model.IWorkingCopy#restore()
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.210
diff -u -r1.210 ChangeLog
--- ChangeLog	19 Oct 2003 01:17:22 -0000	1.210
+++ ChangeLog	20 Oct 2003 21:05:53 -0000
@@ -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
 
 	New Binary Parser tab page for Cygwin PE Parser.
Index: src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java,v
retrieving revision 1.4
diff -u -r1.4 CReconcilingStrategy.java
--- src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java	30 Sep 2003 14:16:26 -0000	1.4
+++ src/org/eclipse/cdt/internal/ui/text/CReconcilingStrategy.java	20 Oct 2003 21:06:00 -0000
@@ -64,22 +64,23 @@
 	 * @see IReconcilingStrategy#reconcile(dirtyRegion, region)
 	 */
 	public void reconcile(DirtyRegion dirtyRegion, IRegion region) {
-		// FIXME: This seems to generate to much flashing in
-		// the contentouline viewer.
-		//reconcile();
+		reconcile();
 	}
 	
 	private void reconcile() {
+		boolean doUpdate = false;
 		try {
 			ITranslationUnit tu = fManager.getWorkingCopy(fEditor.getEditorInput());		
 			if (tu != null && tu.isWorkingCopy()) {
 				IWorkingCopy workingCopy = (IWorkingCopy)tu;
 				// reconcile
 				synchronized (workingCopy) {
-					workingCopy.reconcile(true, fProgressMonitor);
+					doUpdate = workingCopy.reconcile(true, fProgressMonitor);
 				}
 			}
-			fOutliner.contentUpdated();
+			if(doUpdate){				
+				fOutliner.contentUpdated();
+			}
 		} catch(CModelException e) {
 				
 		}

Back to the top