Hello,
I have a DBSRichViewEdit1 and a TrichViewEdit
When I insert a footnote, in my DBSRichViewEdit1 is added the number 1 and it is ok, but when it is insert into TrichViewEdit (footnote), it is inserting '?' and not the number 1.
Why? What's wrong?
I debugged and all the code is the same of your example.
Thanks
problem with footnote
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 184
- Joined: Wed Jan 18, 2012 6:22 pm
Hi, it is correct, take a look at the code:
this is the code:
procedure TFTMNLeitor.insertFootNote;
var
FootNote : TRVFootnoteItemInfo;
NoteRef : TRVNoteReferenceItemInfo;
Editor : TDBSRichViewEdit;
Rvs : TRVStyle;
Begin
Rvs := Editor.ExternalRVStyle;
FootNote := TRVFootnoteItemInfo.CreateEx(DBSRichViewEdit1.RichViewEdit.RVData, RVGetNoteTextStyleNo(Rvs, DBSRichViewEdit1.RichViewEdit.CurTextStyleNo), 1, False);
NoteRef := TRVNoteReferenceItemInfo.CreateEx(FootNote.Document, RVGetNoteTextStyleNo(Rvs,0));
FootNote.Document.AddItem('', NoteRef);
FootNote.Document.AddNL(' ', 0, -1);
if DBSRichViewEdit1.RichViewEdit.InsertItem('', FootNote) then
rveNote.SetFocus;
End;
procedure TFTMNLeitor.EditNote(NoteItem: TCustomRVNoteItemInfo);
var
Stream: TMemoryStream;
begin
if FActiveNoteItem = NoteItem then
exit;
FActiveNoteItem := NoteItem;
rveNote.NoteText := rveNote.NoteText; // this text is displayed in
// TRVNoteReferenceItemInfo items
rveNote.Enabled := True;
rveNote.Color := clWindow;
rveNote.Clear;
Stream := TMemoryStream.Create;
try
NoteItem.Document.SaveRVFToStream(Stream);
Stream.Position := 0;
rveNote.LoadRVFFromStream(Stream);
finally
Stream.Free;
end;
with rveNote do begin
Format;
SetSelectionBounds(ItemCount-1, GetOffsAfterItem(ItemCount-1),
ItemCount-1, GetOffsAfterItem(ItemCount-1));
end;
end;
in my DBSRichViewEdit1, it insert the number correctly but in my footNote, only an exclamation.
Why?[/img]
this is the code:
procedure TFTMNLeitor.insertFootNote;
var
FootNote : TRVFootnoteItemInfo;
NoteRef : TRVNoteReferenceItemInfo;
Editor : TDBSRichViewEdit;
Rvs : TRVStyle;
Begin
Rvs := Editor.ExternalRVStyle;
FootNote := TRVFootnoteItemInfo.CreateEx(DBSRichViewEdit1.RichViewEdit.RVData, RVGetNoteTextStyleNo(Rvs, DBSRichViewEdit1.RichViewEdit.CurTextStyleNo), 1, False);
NoteRef := TRVNoteReferenceItemInfo.CreateEx(FootNote.Document, RVGetNoteTextStyleNo(Rvs,0));
FootNote.Document.AddItem('', NoteRef);
FootNote.Document.AddNL(' ', 0, -1);
if DBSRichViewEdit1.RichViewEdit.InsertItem('', FootNote) then
rveNote.SetFocus;
End;
procedure TFTMNLeitor.EditNote(NoteItem: TCustomRVNoteItemInfo);
var
Stream: TMemoryStream;
begin
if FActiveNoteItem = NoteItem then
exit;
FActiveNoteItem := NoteItem;
rveNote.NoteText := rveNote.NoteText; // this text is displayed in
// TRVNoteReferenceItemInfo items
rveNote.Enabled := True;
rveNote.Color := clWindow;
rveNote.Clear;
Stream := TMemoryStream.Create;
try
NoteItem.Document.SaveRVFToStream(Stream);
Stream.Position := 0;
rveNote.LoadRVFFromStream(Stream);
finally
Stream.Free;
end;
with rveNote do begin
Format;
SetSelectionBounds(ItemCount-1, GetOffsAfterItem(ItemCount-1),
ItemCount-1, GetOffsAfterItem(ItemCount-1));
end;
end;
in my DBSRichViewEdit1, it insert the number correctly but in my footNote, only an exclamation.
Why?[/img]