Revision: 3835
          http://vexi.svn.sourceforge.net/vexi/?rev=3835&view=rev
Author:   clrg
Date:     2010-04-13 22:59:19 +0000 (Tue, 13 Apr 2010)

Log Message:
-----------
Fix for reflow request during parent assignment

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2010-04-09 01:30:29 UTC 
(rev 3834)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2010-04-13 22:59:19 UTC 
(rev 3835)
@@ -489,21 +489,15 @@
     }
     private final void setConstrainInTree() throws JSExn {
         Box b=this;
-        try {
-            // FIXME: box tree is getting into inconsistent states with 
CONSTRAIN_DESCENDENT
-            while (b.test(DISPLAY) && b.parent!=null) {// && 
!b.parent.test(CONSTRAIN_DESCENDENT)) {
-                b = b.parent;
-                b.set(CONSTRAIN_DESCENDENT);
-            }
-            Surface s = b.getSurface();
-            if (s!=null) {
-                s.abortReflow();
-            }
-        } catch (JSExn e) {
-            Log.warn(Box.class,"Caught JS Exception while putting to trap 
\""+name+"\"");
-            e.printStackTrace(Logger.WARN, Log.user, Box.class);
-            throw e;
+        // FIXME: box tree is getting into inconsistent states with 
CONSTRAIN_DESCENDENT
+        while (b.test(DISPLAY) && b.parent!=null) {// && 
!b.parent.test(CONSTRAIN_DESCENDENT)) {
+            b = b.parent;
+            b.set(CONSTRAIN_DESCENDENT);
         }
+        Surface s = b.getSurface();
+        if (s!=null) {
+            s.abortReflow();
+        }
     }
     
     private final void setPlace() throws JSExn { set(PLACE); setPlaceInTree(); 
}
@@ -514,20 +508,14 @@
     }
     private final void setPlaceInTree() throws JSExn {
         Box b=this;
-        try {
-            while (b.test(DISPLAY) && b.parent!=null && 
!b.parent.test(PLACE_DESCENDENT)) {
-                b = b.parent;
-                b.set(PLACE_DESCENDENT);
-            }
-            Surface s = b.getSurface();
-            if (s!=null) {
-                s.abortReflow();
-            }
-        } catch (JSExn e) {
-            Log.warn(Box.class,"Caught JS Exception while putting to trap 
\""+name+"\"");
-            e.printStackTrace(Logger.WARN, Log.user, Box.class);
-            throw e;
+        while (b.test(DISPLAY) && b.parent!=null && 
!b.parent.test(PLACE_DESCENDENT)) {
+            b = b.parent;
+            b.set(PLACE_DESCENDENT);
         }
+        Surface s = b.getSurface();
+        if (s!=null) {
+            s.abortReflow();
+        }
     }
     private final void setPlaceNoAbort () {
         Box b=this;
@@ -3033,6 +3021,7 @@
                 return;
             }
             if (test(DISPLAY)) {
+                // parent has not changed; no constrain necessary
                 oldparent.setPlace();
                 dirty();
             }
@@ -3081,22 +3070,22 @@
         // * also called by put(index, null...)
         
         if (newparent != null) {
+            // assign new parent
             newparent.insertNode(i, this);
+            parent = newparent;
             if (test(DISPLAY)) {
-                // REMARK we must dirty because it is possible that reflow
-                // may not occur in the case the box has previously been
-                // constrained/placed but is smaller than its new parent
+                // REMARK we must dirty because there is an infrequent, but 
easy to
+                // encounter, case whereby reflow invokes no change in 
parent/child
+                // dimensions or child positioning
                 dirty();
+                // requestReflow must happen after parent assignment otherwise 
calls
+                // to setContrainInTree/setPlaceInTree are rendered ineffective
                 requestReflow();
                 if (newparent.test(PACK) || !newparent.test(CLIP)) {
                     newparent.setConstrain();
                 }
                 newparent.setPlace();
-                newparent.set(PLACE_DESCENDENT);
-                newparent.set(CONSTRAIN_DESCENDENT);
             }
-            // assign new parent
-            parent = newparent;
         }
         // call post-cascade traps
         if (trapchain!=null) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to