How to use the ApplyElementStyleNameOperation?
Hi,
I'm trying to appl style on a selected text using the "ApplyElementStyleNameOperation".
But what I get is that all the text from beginning of selection till end of text is deleted.
The code is as follows:
var txtSel:SelectionState= new SelectionState(_focusedTextArea.textFlow,_focusedTextArea.selectionAnchorPosition,_focusedTextArea.selectionActivePosition);
var applyStyle:ApplyElementStyleNameOperation = new ApplyElementStyleNameOperation(txtSel,_focusedTextArea.textFlow,STYLE_NAME,
_focusedTextArea
.selectionAnchorPosition,_focusedTextArea.selectionActivePosition);
var ed:EditManager = EditManager(_focusedTextArea.textFlow.interactionManager);
ed.doOperation(applyStyle);
I've debugged and found out that the flowElements disappears inside the EditManger.doOperation, after the line "operation = doInternal(operation);"
Can anyone help ?
