It looks like there are bug in export of numbered lists into RTF. To reproduce it do the following:
1. Create some numbered list in RichViewEdit.
2. Select several lines fully and copy them into Clipboard.
3. Paste in MSWord (or paste as RTF).
After these steps you will see in MSWord numbered list, but last line will be not marked as list item.
How can it be solved?
Bug on export of lists into RTF
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
In TRichView development, there were several different solutions for saving attributes of the last copied paragraph (these attributes include bullet). MS Word ignores attributes of the last pasted paragraph, if ending "end of paragraph" mark (\par keyword) is not saved.
If I save \par at the end of any copied RTF content, extra line break will be added, it is undesirable.
I do not remember how it works in v1.9.24. The latest version (for registered users) saves \par only if the selection ends at the end of the document.
In the next update, it will also be saved if the selection ends at the end of paragraph.
This is also not a perfect solution, but I think it's more similar to MS Word (MS Word has "end of paragraph" mark as invisible character)
If I save \par at the end of any copied RTF content, extra line break will be added, it is undesirable.
I do not remember how it works in v1.9.24. The latest version (for registered users) saves \par only if the selection ends at the end of the document.
In the next update, it will also be saved if the selection ends at the end of paragraph.
This is also not a perfect solution, but I think it's more similar to MS Word (MS Word has "end of paragraph" mark as invisible character)
One thing also - connecting to saving to rtf format. Actions "forget" about lists (bullets,numbering).
When we save as RTF (f.e save readme.rvf with ActionTest as rtf) and open again we can see lists and add items to them but according buttons (with rvActionsResource.rvActionParaBullets1, rvActionsResource.rvActionParaNumbering1) do not change their status when we move to lists.
Or do we have to change some settings in saving? I used default as their set in demo.
Word can load and "understand" those lists.
When we save as RTF (f.e save readme.rvf with ActionTest as rtf) and open again we can see lists and add items to them but according buttons (with rvActionsResource.rvActionParaBullets1, rvActionsResource.rvActionParaNumbering1) do not change their status when we move to lists.
Or do we have to change some settings in saving? I used default as their set in demo.
Word can load and "understand" those lists.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Well, currently TrvActionParaBullets and TrvActionParaNumbering are checked only if the current paragraphs have bullets/numbering with exactly the same attributes as specified in their ListStyles property.
The problem is because when saving/reopening RTF, not all attributes are exactly the same as in the original values (because (1) paragraph attributes override them, (2) StartFrom properties are compared that make no sense for bullets).
Will be fixed in the next update.
The problem is because when saving/reopening RTF, not all attributes are exactly the same as in the original values (because (1) paragraph attributes override them, (2) StartFrom properties are compared that make no sense for bullets).
Will be fixed in the next update.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Assuming that you have the latest version of TRichView.
1) RVStyle.pas, function TRVListLevel.IsSimpleEqual
Change the lineto2) CRVData.pas, function TCustomRVData.SaveRTFToStream
Between the linesandadd:
1) RVStyle.pas, function TRVListLevel.IsSimpleEqual
Change the line
Code: Select all
(StartFrom = Value.StartFrom) and
Code: Select all
(not HasNumbering or (StartFrom = Value.StartFrom)) and
Between the lines
Code: Select all
if (MarkerItemNo<>StartItem) and (GetItemStyle(MarkerItemNo)=rvsListMarker) then begin
Code: Select all
GetItem(MarkerItemNo).SaveRTF(Stream, Path, Self, MarkerItemNo,
Code: Select all
if (rvrtfSaveStyleSheet in RTFOptions) and
RVStyle.ParaStyles[GetItem(MarkerItemNo).ParaNo].Standard then
RVFWrite(Stream, Format('\s%d', [GetItem(MarkerItemNo).ParaNo]));
SaveParaStyle(GetItem(MarkerItemNo).ParaNo, ColorList,False, GetItem(MarkerItemNo));