How does one go about creating a "clone" of one RVE into another RVE, including item tag values and newlines?
Also, if I'm iterating over rve.RVData.Items (so to speak), how do I detect the presence of newlines?
I tried copying all RVData items from one to the other, but it lost page formatting.
cloning and finding EOLs
Hi David,
Streaming most certainly can accomplish what you want. Could your problem be related to styles not being added properly? Specifically, perhaps RVFTextStylesReadMode is not rvf_sInsertMerge in your case? Assuming you are using 2 different RVStyle components, that is.
See if it's something like that. Or post more info if everything seems to be already as it should be, - because it should definitely work.
Good luck,
Michel
Streaming most certainly can accomplish what you want. Could your problem be related to styles not being added properly? Specifically, perhaps RVFTextStylesReadMode is not rvf_sInsertMerge in your case? Assuming you are using 2 different RVStyle components, that is.
See if it's something like that. Or post more info if everything seems to be already as it should be, - because it should definitely work.
Good luck,
Michel
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
How would I go through a document and prep it for viewing in HTML by changing single newlines to <BR> and double newlines to <P> tags?
I've got other HTML tags in this document, and when I use SaveToHTML, it escapes the tags so they show up as text rather than "real tags". That is, I've got HTML Anchor tags in the text that I want to appear as live links in the browser. Perhaps there's some way to tell RVE not to do this?
Thanks
-David
I've got other HTML tags in this document, and when I use SaveToHTML, it escapes the tags so they show up as text rather than "real tags". That is, I've got HTML Anchor tags in the text that I want to appear as live links in the browser. Perhaps there's some way to tell RVE not to do this?
Thanks
-David
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This procedure converts all single line breaks to "soft" line breaks (which can be added by Shift+Return keys). Double line breaks remain paragraph breaks (which can be added by Return key), but empty line is removed (actually, all empty lines are removed)
Code: Select all
procedure NormalizeLineBreaks(RVData: TCustomRVData);
var i,r,c: Integer;
table: TRVTableItemInfo;
begin
for i := RVData.ItemCount-1 downto 0 do begin
if RVData.IsParaStart(i) then begin
// removing empty line
if RVData.IsParaStart(i) and (RVData.GetItemStyle(i)>=0) and
(RVData.ItemCount>0) then begin
RVData.DeleteItems(i,1);
continue;
end;
// converting "Return-linebreak" to "Shift+Return-linebreak", if
// there is no empty line before. Making sure that this conversion is
// not applied to tables and breaks, items after them, and the very first
// item
if (i>0) and not RVData.GetItem(i).GetBoolValue(rvbpFullWidth) and
not RVData.GetItem(i-1).GetBoolValue(rvbpFullWidth) and
not ((RVData.GetItemStyle(i-1)>=0) and (RVData.GetItemText(i-1)='')) then
RVData.GetItem(i).BR := True;
continue;
end;
// recursive table traversal
if RVData.GetItemStyle(i)=rvsTable then begin
table := TRVTableItemInfo(RVData.GetItem(i));
for r := 0 to table.Rows.Count-1 do
for c := 0 to table.Rows[r].Count-1 do
if table.Cells[r,c]<>nil then
NormalizeLineBreaks(table.Cells[r,c].GetRVData);
end;
end;
end;
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: