Moved the logic for composing the table on cell resizing out of EditManager and into StandardFlowComposer where it belongs.
diff --git a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
index 9c93e94..5557167 100644
--- a/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
+++ b/textLayout/src/flashx/textLayout/compose/StandardFlowComposer.as
@@ -20,7 +20,7 @@
{
import flash.display.Sprite;
import flash.system.Capabilities;
-
+
import flashx.textLayout.accessibility.TextAccImpl;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.container.ScrollPolicy;
@@ -28,8 +28,11 @@
import flashx.textLayout.edit.ISelectionManager;
import flashx.textLayout.elements.BackgroundManager;
import flashx.textLayout.elements.ContainerFormattedElement;
+ import flashx.textLayout.elements.TableCellElement;
+ import flashx.textLayout.elements.TableElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.events.CompositionCompleteEvent;
+ import flashx.textLayout.events.ModelChange;
import flashx.textLayout.formats.BlockProgression;
import flashx.textLayout.tlf_internal;
@@ -550,7 +553,15 @@
//CONFIG::debug { assert(!_composing,"updateToController: compose in process"); }
if (_composing)
return false;
-
+
+ var cellHeight:Number = 0;
+ if(textFlow.nestedInTable())
+ {
+ var controller:ContainerController = getControllerAt(0);
+ if (controller)
+ cellHeight = controller.container.height;
+
+ }
//note that this will always update the display AND update the
//selection. So, even if nothing has changed that would cause
//a recompose, the selection would still be redrawn.
@@ -563,6 +574,17 @@
if (shapesDamaged)
updateCompositionShapes();
+ // recompose the containing table if the cell height changed.
+ // This should be ok because updateAllControllers() should be ignored if the parent textFlow is in middle of a compose.
+ if(cellHeight && controller.container.height != cellHeight)
+ {
+ var table:TableElement = (textFlow.parentElement as TableCellElement).getTable();
+ table.modelChanged(ModelChange.ELEMENT_MODIFIED, table, 0, table.textLength);
+ table.getTextFlow().flowComposer.updateAllControllers();
+ if(sm && sm.focused)
+ controller.setFocus();
+ }
+
if (sm)
sm.refreshSelection();
return shapesDamaged;
diff --git a/textLayout/src/flashx/textLayout/edit/EditManager.as b/textLayout/src/flashx/textLayout/edit/EditManager.as
index 0eaafeb..b0ab077 100644
--- a/textLayout/src/flashx/textLayout/edit/EditManager.as
+++ b/textLayout/src/flashx/textLayout/edit/EditManager.as
@@ -852,19 +852,8 @@
redrawListener = null;
}
- var cellHeight:Number = 0;
if (textFlow.flowComposer)
{
- if(superManager && superManager is IEditManager)
- {
- var controller:ContainerController = textFlow.flowComposer.getControllerAt(0);
- if (controller)
- {
- cellHeight = controller.container.height;
- }
- }
-
-
textFlow.flowComposer.updateAllControllers();
// Scroll to selection
@@ -874,18 +863,6 @@
if (controllerIndex >= 0)
textFlow.flowComposer.getControllerAt(controllerIndex).scrollToRange(activePosition,anchorPosition);
}
- if(superManager && superManager is IEditManager)
- {
- if(controller.container.height != cellHeight)
- {
- var setFormat:String = selectionFormatState;
- var table:TableElement = (textFlow.parentElement as TableCellElement).getTable();
- table.modelChanged(ModelChange.ELEMENT_MODIFIED, table, 0, table.textLength);
- (superManager as IEditManager).updateAllControllers();
- if(setFormat == SelectionFormatState.FOCUSED)
- setFocus();
- }
- }
}
selectionChanged(true, false);