fixes for debugging

git-svn-id: trunk@3166 -
This commit is contained in:
mattias 2002-08-18 16:50:09 +00:00
parent f0590fba4f
commit ae12a98a40
9 changed files with 52 additions and 44 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;