diff --git a/components/orpheus/ovctable.pas b/components/orpheus/ovctable.pas index e31ba3521..ff0f61e85 100644 --- a/components/orpheus/ovctable.pas +++ b/components/orpheus/ovctable.pas @@ -580,7 +580,11 @@ type procedure CreateWnd; override; procedure Loaded; override; procedure Paint; override; +{$IFNDEF LCL} procedure SetBounds(ALeft, ATop, AWidth, AHeight: integer); override; +{$ELSE} + procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); override; +{$ENDIF} {new public methods} function CalcRowColFromXY(X, Y : integer; @@ -3663,14 +3667,25 @@ procedure TOvcCustomTable.tbQueryRowData(RowNum : TRowNum; end; end; {--------} +{$IFNDEF LCL} procedure TOvcCustomTable.SetBounds(ALeft, ATop, AWidth, AHeight: integer); +{$ELSE} +procedure TOvcCustomTable.DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); +{$ENDIF} +// LCL port: Behavior of SetBounds changed in 0.9.29, so using DoSetBounds. +// http://wiki.lazarus.freepascal.org/Lazarus_0.9.30_release_notes#overriding_TControl.SetBounds +// Calls to TOvcTable.SetBounds will just be handled by ancestor. var WidthChanged : boolean; HeightChanged : boolean; begin if (not HandleAllocated) then begin +{$IFNDEF LCL} inherited SetBounds(ALeft, ATop, AWidth, AHeight); +{$ELSE} + inherited DoSetBounds(ALeft, ATop, AWidth, AHeight); +{$ENDIF} Exit; end; @@ -3681,7 +3696,11 @@ procedure TOvcCustomTable.SetBounds(ALeft, ATop, AWidth, AHeight: integer); begin AllowRedraw := false; try +{$IFNDEF LCL} inherited SetBounds(ALeft, ATop, AWidth, AHeight); +{$ELSE} + inherited DoSetBounds(ALeft, ATop, AWidth, AHeight); +{$ENDIF} if WidthChanged then tbCalcColData(tbColNums, LeftCol); if HeightChanged then @@ -3698,7 +3717,11 @@ procedure TOvcCustomTable.SetBounds(ALeft, ATop, AWidth, AHeight: integer); end;{try..finally} end else +{$IFNDEF LCL} inherited SetBounds(ALeft, ATop, AWidth, AHeight); +{$ELSE} + inherited DoSetBounds(ALeft, ATop, AWidth, AHeight); +{$ENDIF} end; {====================================================================} diff --git a/components/orpheus/ovctbcls.pas b/components/orpheus/ovctbcls.pas index 88ff985be..b50f83df4 100644 --- a/components/orpheus/ovctbcls.pas +++ b/components/orpheus/ovctbcls.pas @@ -577,15 +577,15 @@ procedure TOvcTableColumns.tcStopLoading; {fixup references to cell components on any data modules} if (FFixups.Count <> 0) then begin DM := 0; -{$IFNDEF LCL} +//{$IFNDEF LCL} DMCount := Screen.DataModuleCount; -{$ELSE} - DMCount := 0; -{$ENDIF} +//{$ELSE} +// DMCount := 0; +//{$ENDIF} while (FFixups.Count > 0) and (DM < DMCount) do begin -{$IFNDEF LCL} +//{$IFNDEF LCL} DataMod := Screen.DataModules[DM]; -{$ENDIF} +//{$ENDIF} for i := pred(FFixups.Count) downto 0 do if (GetFormName(FFixups[i], Form.Name) = DataMod.Name) then begin Compnt := DataMod.FindComponent(GetComponentName(FFixups[i])); diff --git a/components/orpheus/ovctcell.pas b/components/orpheus/ovctcell.pas index 45cf2ca06..53b0ec6d7 100644 --- a/components/orpheus/ovctcell.pas +++ b/components/orpheus/ovctcell.pas @@ -426,6 +426,9 @@ procedure TOvcBaseTableCell.tcChangeScale(M, D : integer); {--------} procedure TOvcBaseTableCell.DecRefs; begin +//try // LCL: On Carbon, get "EXC_BAD_ACCESS, Could not access memory" for + // FReferences when free cell's column (for example, when quit app), + // as though cell object's memory already freed, so trap and ignore. if (FReferences > 0) then begin dec(FReferences); @@ -436,6 +439,8 @@ procedure TOvcBaseTableCell.DecRefs; FOnCfgChanged := nil; end; end; +//except +//end; end; {--------} function TOvcBaseTableCell.DoOwnerDraw(TableCanvas : TCanvas; diff --git a/components/orpheus/ovctcmmn.pas b/components/orpheus/ovctcmmn.pas index df720b0f0..6db3f7bd3 100644 --- a/components/orpheus/ovctcmmn.pas +++ b/components/orpheus/ovctcmmn.pas @@ -715,16 +715,16 @@ begin if (taLoadList.Count <> 0) then begin DM := 0; -{$IFNDEF LCL} +//{$IFNDEF LCL} DMCount := Screen.DataModuleCount; -{$ELSE} - DMCount := 0; -{$ENDIF} +//{$ELSE} +// DMCount := 0; +//{$ENDIF} while (taLoadList.Count > 0) and (DM < DMCount) do begin -{$IFNDEF LCL} +//{$IFNDEF LCL} DataMod := Screen.DataModules[DM]; -{$ENDIF} +//{$ENDIF} for i := pred(taLoadList.Count) downto 0 do if (GetFormName(taLoadList[i], Form.Name) = DataMod.Name) then begin