Reset StyleTemplates

General TRichView support forum. Please post your questions here
Post Reply
standay
Posts: 331
Joined: Fri Jun 18, 2021 3:07 pm

Reset StyleTemplates

Post by standay »

Hi Sergey,

Is there a way to reset styletemplates to the usual defaults plus whatever is currently in use in my application? Sometimes I'll paste in some HTML text by mistake (I wanted to paste plain text). When I do that I wind up with a bunch of HTML styles that I don't need. I'd like to be able to delete all those styles I'm not using. The only way I can do it now is to use the styles dialog and delete them one by one.

Thanks

Stan
Sergey Tkachenko
Site Admin
Posts: 18029
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Reset StyleTemplates

Post by Sergey Tkachenko »

There is no special method to reset StyleTemplates.

If you want to remove them in code, do it in the way shown in the topic https://www.trichview.com/help/idh_tric ... lates.html

Code: Select all

RVStyleTmp.Units := RichViewEdit1.Style.Units;
RVStyleTmp.StyleTemplates.AssignStyleTemplates(RichViewEdit1.Style.StyleTemplates, True);
<<remove extra items from RVStyleTmp.StyleTemplates here>>
RichViewEdit1.ChangeStyleTemplates(RVStyleTmp.StyleTemplates);
where RVStyleTmp: TRVStyle component not linked to any TRichView.
standay
Posts: 331
Joined: Fri Jun 18, 2021 3:07 pm

Re: Reset StyleTemplates

Post by standay »

OK, I'll try that.

Thanks Sergey

Stan
Post Reply