diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 20a808dc0e..89e390a91c 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -1257,7 +1257,7 @@ begin // insert all nodes of specific type while ANodeExt<>nil do begin IsVariable:=NodeExtIsVariable(ANodeExt); - if (ord(PartType)=ANodeExt.Flags) then begin + if (cardinal(ord(PartType))=ANodeExt.Flags) then begin // search a destination section if NodeExtIsPrivate(ANodeExt) then begin // search a privat section in front of the node diff --git a/components/codetools/laz_dom.pas b/components/codetools/laz_dom.pas index 04456f851d..7e4cd44f39 100644 --- a/components/codetools/laz_dom.pas +++ b/components/codetools/laz_dom.pas @@ -1092,7 +1092,7 @@ end; function TDOMCharacterData.SubstringData(offset, count: LongWord): DOMString; begin - if (offset < 0) or (offset > Length) or (count < 0) then + if (offset < 0) or (longint(offset) > Length) or (count < 0) then raise EDOMIndexSize.Create('CharacterData.SubstringData'); Result := Copy(FNodeValue, offset + 1, count); end; @@ -1104,7 +1104,7 @@ end; procedure TDOMCharacterData.InsertData(offset: LongWord; const arg: DOMString); begin - if (offset < 0) or (offset > Length) then + if (offset < 0) or (longint(offset) > Length) then raise EDOMIndexSize.Create('CharacterData.InsertData'); FNodeValue := Copy(FNodeValue, 1, offset) + arg + @@ -1113,7 +1113,7 @@ end; procedure TDOMCharacterData.DeleteData(offset, count: LongWord); begin - if (offset < 0) or (offset > Length) or (count < 0) then + if (offset < 0) or (longint(offset) > Length) or (count < 0) then raise EDOMIndexSize.Create('CharacterData.DeleteData'); FNodeValue := Copy(FNodeValue, 1, offset) + @@ -1511,7 +1511,7 @@ end; function TDOMText.SplitText(offset: LongWord): TDOMText; begin - if offset > Length then + if longint(offset) > Length then raise EDOMIndexSize.Create('Text.SplitText'); Result := TDOMText.Create(FOwnerDocument); @@ -1633,6 +1633,9 @@ end. { $Log$ + Revision 1.6 2002/08/18 16:50:09 mattias + fixes for debugging + Revision 1.5 2002/12/18 17:52:18 mattias fixed lazarus xml files for fpc 1.1 diff --git a/components/synedit/synregexpr.pas b/components/synedit/synregexpr.pas index 7c52103a20..f194ee3114 100644 --- a/components/synedit/synregexpr.pas +++ b/components/synedit/synregexpr.pas @@ -1946,7 +1946,7 @@ function TRegExpr.CompileRegExpr (exp : PRegExprChar) : boolean; // of the structure of the compiled regexp. var scan, longest : PRegExprChar; - len : cardinal; + len : integer; flags : integer; begin Result := false; // life too dark diff --git a/ide/inputfiledialog.pas b/ide/inputfiledialog.pas index 29a6a01c46..528682e1ad 100644 --- a/ide/inputfiledialog.pas +++ b/ide/inputfiledialog.pas @@ -90,7 +90,7 @@ type destructor Destroy; override; procedure BeginUpdate; procedure EndUpdate; - procedure Update; + procedure UpdateDlg; function FilenameIsValidForFileIndex(Filename: string; Index: integer): boolean; public @@ -231,26 +231,26 @@ procedure TInputFileDialog.SetFileDescriptions(Index: integer; const AValue: string); begin FFileDescs[Index]:=AValue; - Update; + UpdateDlg; end; procedure TInputFileDialog.SetFileTitles(Index: integer; const AValue: string); begin FFileTitles[Index]:=AValue; - Update; + UpdateDlg; end; procedure TInputFileDialog.SetFileFlags(Index: integer; const AValue: TInputFileFlags); begin FFileFlags[Index]:=AValue; - Update; + UpdateDlg; end; procedure TInputFileDialog.SetFilenames(Index: integer; const AValue: string); begin FFileNames[Index]:=AValue; - Update; + UpdateDlg; end; procedure TInputFileDialog.SetTransferMacros(const AValue: TTransferMacroList); @@ -258,7 +258,7 @@ begin FTransferMacros:=AValue; end; -procedure TInputFileDialog.Update; +procedure TInputFileDialog.UpdateDlg; begin if (FUpdateCount<>0) or (not UpdateNeeded) then exit; CreateInputComponents; @@ -617,7 +617,7 @@ begin if FUpdateCount<=0 then exit; dec(FUpdateCount); if FUpdateCount=0 then - Update; + UpdateDlg; end; end. diff --git a/lcl/include/canvas.inc b/lcl/include/canvas.inc index 6ffa26aba4..3ec1a3a591 100644 --- a/lcl/include/canvas.inc +++ b/lcl/include/canvas.inc @@ -161,13 +161,13 @@ end; ------------------------------------------------------------------------------} procedure TCanvas.CreateFont; -var OldHandle: HPEN; +var OldHandle: HFONT; begin OldHandle:=SelectObject(FHandle, Font.Handle); if (OldHandle<>Font.Handle) and (FSavedFontHandle=0) then FSavedFontHandle:=OldHandle; Include(FState, csFontValid); - SetTextColor(FHandle, Font.Color); + SetTextColor(FHandle, TColorRef(Font.Color)); end; {------------------------------------------------------------------------------ @@ -1066,15 +1066,16 @@ procedure TCanvas.RequiredState(ReqState: TCanvasState); var Needed: TCanvasState; begin -//writeln('[TCanvas.RequiredState] ',csHandleValid in ReqState,' ',csHandleValid in FState); Needed := ReqState - FState; + //writeln('[TCanvas.RequiredState] ',ClassName,' ',csHandleValid in ReqState,' ',csHandleValid in FState,' Needed=',Needed<>[]); if Needed <> [] then begin + //writeln('[TCanvas.RequiredState] B ',ClassName,' ',csHandleValid in Needed,',',csFontValid in Needed,',',csPenValid in Needed,',',csBrushValid in Needed); if csHandleValid in Needed then begin CreateHandle; - if FHandle = 0 - then raise EInvalidOperation.Create(rsCanvasDoesNotAllowDrawing); + if FHandle = 0 then + raise EInvalidOperation.Create(rsCanvasDoesNotAllowDrawing); Include(FState, csHandleValid); end; if csFontValid in Needed then CreateFont; @@ -1096,20 +1097,12 @@ end; Gets the width and height of a text ------------------------------------------------------------------------------} function TCanvas.TextExtent(const Text: string): TSize; -var - pStr: PChar; begin Result.cX := 0; Result.cY := 0; + if Text='' then exit; RequiredState([csHandleValid, csFontValid]); - - pStr := StrAlloc(Length(Text)+1); - try - StrPCopy(pStr, Text); - GetTextExtentPoint(FHandle, pStr, Length(Text), Result); - finally - StrDispose(PStr); - end; + GetTextExtentPoint(FHandle, PChar(Text), Length(Text), Result); end; {------------------------------------------------------------------------------ @@ -1169,6 +1162,9 @@ end; { ============================================================================= $Log$ + Revision 1.47 2002/08/18 16:50:09 mattias + fixes for debugging + Revision 1.46 2002/08/18 04:57:01 mattias fixed csDashDot diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index c01c164d10..9d6aff0d9c 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -1354,7 +1354,7 @@ begin while (n > 0) do begin dec (n); TimerInfo := PGtkITimerinfo(FTimerData.Items[n]); - if (TimerInfo^.TimerHandle=TimerHandle) then + if (TimerInfo^.TimerHandle=guint(TimerHandle)) then begin {$IFDEF VerboseTimer} writeln('TGTKObject.KillTimer TimerInfo=',HexStr(Cardinal(TimerInfo),8),' TimerHandle=',TimerHandle,' CurTimerCount=',FTimerData.Count,' OldTimerCount=',FOldTimerData.Count); @@ -7420,6 +7420,9 @@ end; { ============================================================================= $Log$ + Revision 1.380 2002/08/18 16:50:09 mattias + fixes for debugging + Revision 1.379 2002/08/18 04:57:01 mattias fixed csDashDot diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc index 02772dbd49..502d4c3801 100644 --- a/lcl/interfaces/gtk/gtkproc.inc +++ b/lcl/interfaces/gtk/gtkproc.inc @@ -571,7 +571,7 @@ begin clWindow, clWindowText, clMenuText, - clGrayText ://should never have a BK Pixmap + clGrayText://should never have a BK Pixmap EnsureAsGCValues; else EnsureAsColor; @@ -4259,6 +4259,9 @@ end; { ============================================================================= $Log$ + Revision 1.186 2002/08/18 16:50:09 mattias + fixes for debugging + Revision 1.185 2002/08/17 23:41:35 mattias many clipping fixes diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 39d6b7fe58..c31b742caf 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -587,7 +587,7 @@ function TgtkObject.ClipboardGetOwnerShip(ClipboardType: TClipboardType; Formats: PClipboardFormat): boolean; var TargetEntries: PGtkTargetEntry; - function IsFormatSupported(FormatID: integer): boolean; + function IsFormatSupported(FormatID: cardinal): boolean; var i: integer; begin if FormatID=0 then begin @@ -1199,8 +1199,9 @@ begin ' Bits=',HexStr(Cardinal(Bits),8),' MemSize(Bits)=',MemSize(Bits), ' biBitCount=',biBitCount);} If BitSize <= 0 then - BitSize := SizeOf(Byte)*(Longint(biSizeImage) div biHeight) - *(NumScans + StartScan); + BitSize := longint(SizeOf(Byte)) + *(longint(biSizeImage) div biHeight) + *longint(NumScans + StartScan); If MemSize(Bits) < BitSize then begin writeln('WARNING: [TgtkObject.InternalGetDIBits] not enough memory allocated for Bits!'); exit; @@ -1246,7 +1247,7 @@ begin if Y<=0 then break; end else begin inc(y); - if Y>=NumScans - 1 then break; + if Y>=longint(NumScans) - 1 then break; end; until false; end @@ -1979,17 +1980,17 @@ function TgtkObject.ComboBoxDropDown(Handle: HWND; DropDown: boolean): boolean; list_requisition^.height := list_requisition^.height + EMPTY_LIST_HEIGHT; alloc_width := (widget^.allocation.width - - 2 * PGtkStyle(popwin^.child^.thestyle)^.klass^.xthickness - + 2 * cardinal(PGtkStyle(popwin^.child^.thestyle)^.klass^.xthickness) - 2 * border_width(GTK_CONTAINER (popwin^.child)^) - 2 * border_width(GTK_CONTAINER (combo^.popup)^) - 2 * border_width(GTK_CONTAINER (GTK_BIN (popup)^.child)^) - - 2 * PGtkStyle(GTK_BIN (popup)^.child^.thestyle)^.klass^.xthickness); + 2 * cardinal(PGtkStyle(GTK_BIN(popup)^.child^.thestyle)^.klass^.xthickness)); - work_height := (2 * (PGtkStyle(popwin^.child^.thestyle)^.klass^.ythickness) + - 2 * border_width(GTK_CONTAINER (popwin^.child)^) + - 2 * border_width(GTK_CONTAINER (combo^.popup)^) + - 2 * border_width(GTK_CONTAINER (GTK_BIN (popup)^.child)^) + - 2 * PGtkStyle(GTK_BIN (popup)^.child^.thestyle)^.klass^.xthickness); + work_height := (2 * cardinal(PGtkStyle(popwin^.child^.thestyle)^.klass^.ythickness) + + 2 * border_width(GTK_CONTAINER (popwin^.child)^) + + 2 * border_width(GTK_CONTAINER (combo^.popup)^) + + 2 * border_width(GTK_CONTAINER (GTK_BIN (popup)^.child)^) + + 2 * cardinal(PGtkStyle(GTK_BIN (popup)^.child^.thestyle)^.klass^.xthickness)); repeat okay_to_exit := True; @@ -4809,7 +4810,6 @@ var UseFont : PGDKFont; UnRef : Boolean; begin - Assert(False, 'trace:> [TgtkObject.GetTextExtentPoint]'); Result := IsValidDC(DC); if Result then with TDeviceContext(DC) do @@ -8436,6 +8436,9 @@ end; { ============================================================================= $Log$ + Revision 1.249 2002/08/18 16:50:09 mattias + fixes for debugging + Revision 1.248 2002/08/18 04:57:01 mattias fixed csDashDot diff --git a/lcl/stringhashlist.pas b/lcl/stringhashlist.pas index 544bcb62c8..7a477d9391 100644 --- a/lcl/stringhashlist.pas +++ b/lcl/stringhashlist.pas @@ -270,10 +270,10 @@ begin case fCaseSensitive of True: for I:= Len -1 downto 0 do - inc(Result, Ord(P[I]) shl I); + inc(Result, cardinal(ord(P[I])) shl I); False: for I:= Len -1 downto 0 do - inc(Result, ord(UpperCaseChars[P[I]]) shl I); + inc(Result, cardinal(ord(UpperCaseChars[P[I]])) shl I); end; end;