Skip to main content
casper_no
Known Participant
Mar 9, 2012 9:14 AM UTC
Question

Remove userStyle entry without ApplyElementUserStyleOperation?

ApplyElementUserStyleOperation is deprecated with TLF 2.0. But I can't find a way to remove a userStyle without it. If I try to use ApplyFormatToElement with a TextLayoutFormat, it won't clear userStyles set to "undefined", just as it won't clear other styles.

Any suggestions? My code is working now using ApplyElementUserStyleOperation, but it always feels wrong to use deprecated methods.

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Adobe Employee
Mar 12, 2012 6:12 AM UTC

Use “delete” to undefine a property

if (val === undefined) delete _styles[val];

Translate
casper_no
casper_noAuthor
Known Participant
Mar 12, 2012 7:06 AM UTC

Good point, I've tried that and it works. But in this case I need to keep the undo-stack intact, and manipulating properties directly reset it. Is there any way of clearing user styles through the EditManager?

Translate
Adobe Employee
Mar 13, 2012 2:35 AM UTC

ClearFormatOnElementOperation or ClearFormatOperation

Translate