From 043ab6bf3ad1bb3f8974849933e1b7d247503d40 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 14 Jul 2004 15:57:53 +0000 Subject: [PATCH] fixed 1.0.10 compilation from Vincent git-svn-id: trunk@5679 - --- ide/todolist.pp | 12 +++++++++++- ideintf/propedits.pp | 3 ++- lcl/comctrls.pp | 9 +++++++++ lcl/controls.pp | 8 ++++++++ lcl/include/listitem.inc | 36 ++++++++++++++++++++++++++++++++++-- 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/ide/todolist.pp b/ide/todolist.pp index 287c333c00..2d675ceb1e 100644 --- a/ide/todolist.pp +++ b/ide/todolist.pp @@ -106,7 +106,10 @@ var implementation uses - StrUtils, FileCtrl; +{$ifndef ver1_0} + StrUtils, +{$endif} + FileCtrl; Type PCharArray = Array[0..16+5] of PChar; @@ -535,6 +538,13 @@ Var TodoFLag := Flag; Result := Pos(UpperCase(Flag),UpperCase(TokenString)) > 1; end; + {$ifdef ver1_0} + //fpc 1.0.x has no strutils unit. + Function AnsiStartsText(const ASubText, AText: string): Boolean; + begin + Result:=Copy(AText,1,Length(AsubText))=ASubText; + end; + {$endif} begin if IsTodoFlag(cTodoFlag) or IsTodoFlag(cAltTodoFlag) then begin diff --git a/ideintf/propedits.pp b/ideintf/propedits.pp index 67c528d2c6..9919612993 100644 --- a/ideintf/propedits.pp +++ b/ideintf/propedits.pp @@ -2155,7 +2155,8 @@ end; function TPropertyEditor.GetObjectValueAt(Index: Integer): TObject; begin - with FPropList^[Index] do Result:=GetObjectProp(Instance,PropInfo); + with FPropList^[Index] do + Result:=GetObjectProp(Instance,PropInfo,nil); // nil for fpc 1.0.x end; function TPropertyEditor.GetDefaultOrdValue: Longint; diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index c04cd02113..bd10daa035 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -312,6 +312,7 @@ type function IsEqual(const AItem: TListItem): Boolean; public procedure Assign(ASource: TPersistent); override; + constructor Create(AOwner : TListItems); destructor Destroy; override; procedure Delete; @@ -546,6 +547,11 @@ type property OnDeletion: TLVDeletedEvent read FOnDeletion write FOnDeletion; property OnSelectItem: TLVSelectItemEvent read FOnSelectItem write FOnSelectItem; property BorderStyle default bsSingle; + {$ifdef ver1_0} + // repeated as workaround for fpc 1.0.x bug, + // which can't access a protected property defined in another unit. + property WidgetSetClass; + {$endif} public constructor Create(Aowner: TComponent); override; destructor Destroy; override; @@ -2298,6 +2304,9 @@ end. { ============================================================================= $Log$ + Revision 1.137 2004/07/14 15:57:53 mattias + fixed 1.0.10 compilation from Vincent + Revision 1.136 2004/07/11 17:20:47 marc * Implemented most of TListColoum/Item in the Ws for gtk and win32 diff --git a/lcl/controls.pp b/lcl/controls.pp index 01e075a8fb..4188c8bdbb 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -1470,6 +1470,11 @@ type // properties which are not supported by all descendents property BorderStyle: TBorderStyle read GetBorderStyle write SetBorderStyle default bsNone; property OnGetSiteInfo: TGetSiteInfoEvent read FOnGetSiteInfo write FOnGetSiteInfo; + {$ifdef ver1_0} + // repeated as workaround for fpc 1.0.x bug, + // which can't access a protected property defined in another unit. + property WidgetSetClass; + {$endif} public // properties which are supported by all descendents property BorderWidth: TBorderWidth read FBorderWidth write SetBorderWidth default 0; @@ -2341,6 +2346,9 @@ end. { ============================================================================= $Log$ + Revision 1.226 2004/07/14 15:57:53 mattias + fixed 1.0.10 compilation from Vincent + Revision 1.225 2004/07/11 13:03:53 mattias extended RolesForForm to manage multiple roles for on control diff --git a/lcl/include/listitem.inc b/lcl/include/listitem.inc index 883215248e..a20ed511a8 100644 --- a/lcl/include/listitem.inc +++ b/lcl/include/listitem.inc @@ -123,10 +123,20 @@ end; procedure TListItemSubItems.Clear; var n: Integer; +{$ifdef ver1_0} +// fpc 1.0.x needs a var parameter for dispose. + io: PListItemImageObject; +{$endif} begin for n := 0 to Count - 1 do - Dispose(PListItemImageObject(inherited GetObject(n))); - + {$ifdef ver1_0} + begin + io := PListItemImageObject(inherited GetObject(n)); + Dispose(io); + end; + {$else} + Dispose(PListItemImageObject(pointer(inherited GetObject(n)))); + {$endif} inherited; end; @@ -139,13 +149,23 @@ begin end; procedure TListItemSubItems.Delete(AIndex: Integer); +{$ifdef ver1_0} +// fpc 1.0.x needs a var parameter for dispose. +var + io: PListItemImageObject; +{$endif} begin if AIndex = Count then FChangeIndex := AIndex else FChangeIndex := -1; FUpdate := [siuText, siuImage]; try + {$ifdef ver1_0} + io := PListItemImageObject(inherited GetObject(AIndex)); + Dispose(io); + {$else} Dispose(PListItemImageObject(inherited GetObject(AIndex))); + {$endif} inherited; finally FUpdate := []; @@ -271,17 +291,26 @@ end; { TListItem.Assign } {------------------------------------------------------------------------------} procedure TListItem.Assign(ASource: TPersistent); + begin + if ASource is TListItem then begin Caption := TListItem(ASource).Caption; + Data := TListItem(ASource).Data; + ImageIndex := TListItem(ASource).ImageIndex; + SubItems := TListItem(ASource).SubItems; + end + else inherited Assign(ASource); + end; + {------------------------------------------------------------------------------} { TListItem Constructor } {------------------------------------------------------------------------------} @@ -535,6 +564,9 @@ end; { ============================================================================= $Log$ + Revision 1.19 2004/07/14 15:57:53 mattias + fixed 1.0.10 compilation from Vincent + Revision 1.18 2004/07/11 17:20:47 marc * Implemented most of TListColoum/Item in the Ws for gtk and win32