TAdvRichEditor, error when pasting text

Hi,

One of our customers encountered an error when pasting text [Ctrl-V] into a TAdvRichEditor component. Looking at the callstack the error is related to the font's name. We cannot reproduce the error, since we don't have the text the user is attempting to paste.

Here's the error message that we received and part of the callstack:

exception class : EAccessViolation
exception message : Access violation at address 50067AF1 in module 'rtl230.bpl'. Read of address 0064008F.

main thread ($18b4):
50067af1 rtl230.bpl System UTF8ToUnicodeString
5096f107 vcl230.bpl Vcl Graphics.TFont.GetName
0d34a072 TMSVCLUIPackPkgExDXE9.bpl Advricheditorbase TAdvRichEditorBase.GetFontName
0d368e69 TMSVCLUIPackPkgExDXE9.bpl Advricheditor TAdvRichEditor.DrawCaret
0d36d2d1 TMSVCLUIPackPkgExDXE9.bpl Advricheditor TAdvRichEditor.Paint
0d30cbcc TMSVCLUIPackPkgExDXE9.bpl Advscrollcontrol TCustomScrollingControl.PaintWindow
50998235 vcl230.bpl Vcl Controls.TWinControl.PaintHandler
0d30d14c TMSVCLUIPackPkgExDXE9.bpl Advscrollcontrol TCustomScrollingControl.WMPaint

Is there any mitigation that we can do? We're using MadExcept for our exception handler. I was thinking of handling the exception and simply continue the execution, but I'm hesitant to do that since I don't know what the side effect might be. Is it possible that the font is embedded in the text that the user is copying from, but not installed in Windows?

It is unclear from this what might be causing it. Without knowing the RTF pasted, this will be hard to figure out. Do you know from where (what other app?) the RTF was pasted? Could there be something special/specific in this RTF (special fonts? images? other specific RTF features?)

Looking more closely at the steps from the Steps Recorder. The user copied the text from a DevExpress RichEdit Control that is embedded in a DevExpress grid. I tried a few times to recreate the error, but I'm unable to. Also, the DevExpress RichEdit component uses the Windows RichEdit DLL, I have it set to use the 4.1 version. Also, all the rich edit fields in that section of the software uses a dialog that has TAdvRichEditor on it, in order to apply any formatting to the text. If they don't use the popup rich editor dialog, there is no formatting and just text.

I don't know if how long an application is running can make any difference(although it shouldn't), because the application was running for 4 hours and 40 minutes, when the error occurred.

But, as you said not knowing the RTF that is being pasted, it might be a little bit more difficult to fix.

Maybe you can implement the AdvRichEditor.OnPasteFormattedText event and save the content for later analysis?

I'll add it as part of the exception handling routine, just in case it happens again. We received this bug report only once, and because of how we have our exception handler setup, the user was forced to exit our software and restart.