Skip to main content
casper_no
Known Participant
March 9, 2012
Question

Remove userStyle entry without ApplyElementUserStyleOperation?

  • March 9, 2012
  • 1 reply
  • 3006 views

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 has been closed for replies.

1 reply

Adobe Employee
March 12, 2012

Use “delete” to undefine a property

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

casper_no
casper_noAuthor
Known Participant
March 12, 2012

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?

Adobe Employee
March 13, 2012

ClearFormatOnElementOperation or ClearFormatOperation