      */
     private function addListeners(textFlow:TextFlow):void
     {
+        textFlow.addEventListener(ComposeDoneEvent.COMPOSE_DONE,
+                                  textFlow_composeDoneHandler);
+        
         textFlow.selectionManager.addEventListener(
             SelectionChangedEvent.SELECTION_CHANGED,
             editManager_selectionChangeHandler);

import text.elements.ParagraphElement;
import text.elements.SpanElement;
import text.elements.TextFlow;
import text.formats.BlockProgression;
import text.formats.CharacterFormat;
import text.formats.ContainerFormat;


    /**
     *  @private
     */
    private function textFlow_composeDoneHandler(event:ComposeDoneEvent):void
    {
        var newContentWidth:Number =
            textFlow.controller.maxHorizontalScrollPosition;
        var newContentHeight:Number =
            textFlow.controller.maxVerticalScrollPosition;
        
        if (newContentWidth != _contentWidth ||
            newContentHeight != _contentHeight)
        {
            _contentWidth = newContentWidth;
            _contentHeight = newContentHeight;
        
            dispatchEvent(new Event("contentSizeChanged"));
        }
    }
    
    /**
     *  @private
     *  Called when the EditManager dispatches a 'selectionChange' event.
     */
    private function editManager_selectionChangeHandler(event:SelectionChangedEvent):void
