Skip to main content
Known Participant
May 24, 2010
Answered

Undo on ApplyFormatOperation not working on blank paragraph

  • May 24, 2010
  • 1 reply
  • 601 views

Steps to repro:

1. Put your cursor in an empty paragraph

2. Set paragraphStartIndent using an ApplyFormatOperation

3. Undo

You will notice the operation wont get undone.

Here is a little video of it.  I used Ctrl+Z to undo. http://screencast.com/t/YzE0ZTc5OTMt

It appears the issue is with this code that gets executed from ParaEdit during the undo

public static function setParagraphStyleChange(flowRoot:TextFlow,begChange:int, endChange:int, coreStyles:Object):void

{

     var beginPara:int = begChange;

     while (beginPara < endChange)

     {

          var para:ParagraphElement = flowRoot.findLeaf(beginPara).getParagraph();

          para.setCoreStylesInternal(coreStyles);

          beginPara = para.getAbsoluteStart() + para.textLength;

     }

}

It seems like it should maybe be beginPara <= endChange in the cases of a  blank paragraph.

Thanks

This topic has been closed for replies.
Correct answer

Thanks for the report. I'll write up a bug.

1 reply

Correct answer
May 24, 2010

Thanks for the report. I'll write up a bug.