View Issue Details

IDProjectCategoryView StatusLast Update
0014984LazarusLCLpublic2011-12-01 11:22
ReporterDomingo Alvarez DuarteAssigned ToPaul Ishenin 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
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);
var
  s: String;
  Section: String;
  Component: TComponent;
begin
  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;
  s:=FMOFile.Translate(Content);
  if (s = '') and (Instance is TComponent) then //<<==== here a check to prevent crash
  begin
    Component := Instance as TComponent;
    if Component.Owner<>nil then
      Section := UpperCase(Component.Owner.Name) + '.';
    Section := 'T' + Section + UpperCase(Component.Name) + '.' +
      UpperCase(PropInfo^.Name);
    s := FMoFile.Translate(Section + 0000004 + Content);
  end;
  if s<>'' then Content:=s;
end;
TagsNo tags attached.
Fixed in Revision23223
LazTarget0.9.30
WidgetsetWin32/Win64
Attached Files

Activities

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