View Issue Details

IDProjectCategoryView StatusLast Update
0014984LazarusLCLpublic2011-12-01 11:22
ReporterDomingo Alvarez Duarte Assigned ToPaul Ishenin  
Status closedResolutionfixed 
Product Version0.9.29 (SVN) 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0014984: Default Translator crashs because TColumTitle isn't a TComponent derived
DescriptionWhen trying to use the DefaultTranslator my application crahs because TColumTitle isn't a TComponent derived, debugging I found where is the problem, the minor addition bellow prevents the crash but doesn't solve the translation problem.
Additional Informationprocedure TDefaultTranslator.TranslateStringProperty(Sender: TObject;
  const Instance: TPersistent; PropInfo: PPropInfo; var Content: string);
  s: String;
  Section: String;
  Component: TComponent;
  if not Assigned(FMOFile) then exit;
  if not Assigned(PropInfo) then exit;
  // do not translate at design time
  if Instance is TComponent then
    if csDesigning in (Instance as TComponent).ComponentState then exit;

  if (UpperCase(PropInfo^.PropType^.Name)<>'TTRANSLATESTRING') then exit;
  if (s = '') and (Instance is TComponent) then //<<==== here a check to prevent crash
    Component := Instance as TComponent;
    if Component.Owner<>nil then
      Section := UpperCase(Component.Owner.Name) + '.';
    Section := 'T' + Section + UpperCase(Component.Name) + '.' +
    s := FMoFile.Translate(Section + 0000004 + Content);
  if s<>'' then Content:=s;
TagsNo tags attached.
Fixed in Revision23223
Attached Files


Paul Ishenin

2009-12-22 05:20

manager   ~0033244

Please test and close if ok.

Issue History

Date Modified Username Field Change
2009-11-03 13:33 Domingo Alvarez Duarte New Issue
2009-11-03 13:33 Domingo Alvarez Duarte Widgetset => Win32/Win64
2009-11-18 21:47 Vincent Snijders LazTarget => 0.9.30
2009-11-18 21:47 Vincent Snijders Status new => acknowledged
2009-11-18 21:47 Vincent Snijders Target Version => 0.9.30
2009-12-22 05:20 Paul Ishenin Fixed in Revision => 23223
2009-12-22 05:20 Paul Ishenin Status acknowledged => resolved
2009-12-22 05:20 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2009-12-22 05:20 Paul Ishenin Resolution open => fixed
2009-12-22 05:20 Paul Ishenin Assigned To => Paul Ishenin
2009-12-22 05:20 Paul Ishenin Note Added: 0033244
2011-12-01 11:22 Marc Weustink Status resolved => closed