 import flashx.textLayout.operations.SplitParagraphOperation;
 
 import mx.core.IViewport;
+import mx.core.ScrollUnit;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
-import mx.core.UIComponent;
-import mx.core.ScrollUnit;
 import mx.events.FlexEvent;
 import mx.events.TextOperationEvent;
 import mx.utils.StringUtil;

{

import flash.display.BlendMode;
import flash.display.Graphics;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.geom.Rectangle;

            return 0;
            
        var maxDelta:Number = contentHeight - scrollR.height - scrollR.y;
        var minDelta:Number = -scrollR.y;
        
        var flowComposer:IFlowComposer = textFlow.flowComposer;
            
        switch (unit)
        {
            case ScrollUnit.UP:
            {
        		return !flowComposer || flowComposer.numControllers == 0 ?
            		   0 :
            		   flowComposer.getControllerAt(0).scrollLines(-1);
            }
                
            case ScrollUnit.DOWN:
            {
        		return !flowComposer || flowComposer.numControllers == 0 ?
					   0 :
					   flowComposer.getControllerAt(0).scrollLines(1);
            }
                
            case ScrollUnit.PAGE_UP:
            {
                return Math.max(minDelta, -scrollR.height);
            }
                
            case ScrollUnit.PAGE_DOWN:
            {
                return Math.min(maxDelta, scrollR.height);
            }
                
            case ScrollUnit.HOME:
            {
                return minDelta;
            }
                
            case ScrollUnit.END:
           	{
                return maxDelta;
            }
                
            default:
            {
                return 0;
            }
        }       
    }
    
