Examples.txt
上传用户:daoqigc
上传日期:2021-04-20
资源大小:2795k
文件大小:2k
- These examples assumes that collection of text, paragraph and list styles
- are not saved in RVF documents (stored in a file or the Registry) (rvfoSave
- In this case, several documents share the same collection of styles.
- RichView.DeleteUnusedStyles cannot be used in this case.
- MarkStylesInUse and DeleteMarkedStyles must be used instead.
- How to remove unused styles in RichView1 and RichView2, linked to the same RVStyle
- uses RVItem;
- data := TRVDeleteUnusedStylesData.Create(True, True, True);
- RichView1.MarkStylesInUse(data);
- RichView2.MarkStylesInUse(data);
- RichView1.DeleteMarkedStyles(data);
- RichView2.DeleteMarkedStyles(data);
- data.Free;
- ===================================================================================
- How to remove unused styles in several documents
- uses CRVData, RVItem;
- data := TRVDeleteUnusedStylesData.Create(True, True, True);
- RichView1.LoadRVF('Doc1.rvf');
- RichView1.MarkStylesInUse(data);
- RichView1.LoadRVF('Doc2.rvf');
- RichView1.MarkStylesInUse(data);
- ...
- RichViewDoNotCheckRVFStyleRefs := True; // global variable from CRVData
- RichView1.LoadRVF('Doc1.rvf');
- RichView1.DeleteMarkedStyles(data);
- RichView1.SaveRVF('Doc1.rvf', False);
- RichView1.LoadRVF('Doc2.rvf');
- RichView1.DeleteMarkedStyles(data);
- RichView1.SaveRVF('Doc2.rvf', False);
- ...
- RichViewDoNotCheckRVFStyleRefs := False;
- data.Free;
- PS: usually it much more simple (and recommended) to use one RVStyle per one
- RichView and store collections of styles inside RVF documents.