Question
How to reset format to e.g. fontWeight==undefined?
I want to reset formats to the default value "undefined" but only get "inherit". Aren't those values for intheritable format properties equal in the TextFlow model?
public function test_reset_format():void
{
var init:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p><span>aaa</span></p></TextFlow>
var textFlow:TextFlow = TextConverter.importToFlow(init, TextConverter.TEXT_LAYOUT_FORMAT)
var editManager:IEditManager = new EditManager()
textFlow.interactionManager = editManager
var format:TextLayoutFormat = new TextLayoutFormat()
format.fontWeight = FontWeight.BOLD
editManager.selectRange(0,1)
editManager.applyLeafFormat(format)
assertEquals(FontWeight.BOLD, textFlow.getFirstLeaf().fontWeight)
var resetFormat:TextLayoutFormat = new TextLayoutFormat()
resetFormat.fontWeight = FormatValue.INHERIT
editManager.applyLeafFormat(resetFormat)
var resetFontWeight:* = textFlow.getFirstLeaf().fontWeight
assertEquals(FormatValue.INHERIT, resetFontWeight)
// How can I reset the format so that assertTrue(undefined == resetFontWeight) passes?
}
Thanks for any hints,
Marc
