Rich text problem
Posted: Tue Mar 26, 2013 11:51 am
Hello
I try to insert some rich text into a cell with this code:
The result must be a simple text with a different font size for letter "a".
As for version 4, this works fine. After migrating to 5.10.08, I get an error:
Is it something wrong with a font table? Tracing into TXLSWorksheet.RichTextLoadFromStream procedure reveals that parameter FR.Font is nil on this line
Please check the issue.
I try to insert some rich text into a cell with this code:
Code: Select all
xlsRW.AsRichText[2, row] := '{\rtf1\ansi \ansicpg1252{\fonttbl{\f0\fnil Times New Roman}} \f0\fs22\ a \f0\fs22\ = 1000 }';
As for version 4, this works fine. After migrating to 5.10.08, I get an error:
Code: Select all
Exception EAccessViolation: Access violation at address 006F57C7 in module 'Myapp.exe'. Read of address 0000001C (OS exception)
exception at $006F57C7 (module "Xc12DataStyleSheet5", proc "Xc12DataStyleSheet5.TXc12Font.GetName", unit "Xc12DataStylesheet5.pas", line 2927)
Stack trace:
Module "Xc12DataStyleSheet5", Procedure "Xc12DataStyleSheet5.TXc12Font.Equal", Unit "Xc12DataStylesheet5.pas", Line 2891
Module "XLSSheetData5", Procedure "XLSSheetData5.TXLSWorksheet.RichTextLoadFromStream", Unit "XLSSheetData5.pas", Line 3246
Module "XLSSheetData5", Procedure "XLSSheetData5.TXLSWorksheet.RichTextLoadFromStream", Unit "XLSSheetData5.pas", Line 3248
Module "XLSSheetData5", Procedure "XLSSheetData5.TXLSWorksheet.SetAsRichText", Unit "XLSSheetData5.pas", Line 3502
Module "XLSSheetData5", Procedure "XLSSheetData5.TXLSWorksheet.SetAsRichText", Unit "XLSSheetData5.pas", Line 3504
Code: Select all
FR[i].Font := FManager.StyleSheet.Fonts.Find(FR[i].Font);