mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 23:26:32 +02:00
fixed uninitialized function results
git-svn-id: trunk@16088 -
This commit is contained in:
parent
d27b3adf0d
commit
c81aab571f
@ -2965,7 +2965,7 @@ end;
|
|||||||
function TextBeginsWith(Txt: PChar; TxtLen: integer; StartTxt: PChar;
|
function TextBeginsWith(Txt: PChar; TxtLen: integer; StartTxt: PChar;
|
||||||
StartTxtLen: integer; CaseSensitive: boolean): boolean;
|
StartTxtLen: integer; CaseSensitive: boolean): boolean;
|
||||||
begin
|
begin
|
||||||
if TxtLen<StartTxtLen then exit;
|
if TxtLen<StartTxtLen then exit(false);
|
||||||
Result:=CompareText(Txt,StartTxtLen,StartTxt,StartTxtLen,CaseSensitive)=0;
|
Result:=CompareText(Txt,StartTxtLen,StartTxt,StartTxtLen,CaseSensitive)=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -177,6 +177,7 @@ function AtomPosition(StartPos, EndPos: integer): TAtomPosition;
|
|||||||
begin
|
begin
|
||||||
Result.StartPos:=StartPos;
|
Result.StartPos:=StartPos;
|
||||||
Result.EndPos:=EndPos;
|
Result.EndPos:=EndPos;
|
||||||
|
Result.Flag:=cafNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CodePosition(P: integer; Code: TCodeBuffer): TCodePosition;
|
function CodePosition(P: integer; Code: TCodeBuffer): TCodePosition;
|
||||||
@ -406,6 +407,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
Result.StartPos:=1;
|
Result.StartPos:=1;
|
||||||
Result.EndPos:=1;
|
Result.EndPos:=1;
|
||||||
|
Result.Flag:=cafNone;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2099,7 +2099,7 @@ var
|
|||||||
function HasCodeBetween(FromPos, ToPos: integer): boolean;
|
function HasCodeBetween(FromPos, ToPos: integer): boolean;
|
||||||
begin
|
begin
|
||||||
if FromPos<1 then FromPos:=1;
|
if FromPos<1 then FromPos:=1;
|
||||||
if FromPos>ToPos then exit;
|
if FromPos>ToPos then exit(false);
|
||||||
MoveCursorToPos(FromPos);
|
MoveCursorToPos(FromPos);
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
Result:=AtomStart<ToPos;
|
Result:=AtomStart<ToPos;
|
||||||
|
@ -1817,7 +1817,7 @@ end;
|
|||||||
function TFindDeclarationTool.FindUnitCaseInsensitive(var AnUnitName,
|
function TFindDeclarationTool.FindUnitCaseInsensitive(var AnUnitName,
|
||||||
AnUnitInFilename: string): string;
|
AnUnitInFilename: string): string;
|
||||||
begin
|
begin
|
||||||
if not CheckDirectoryCache then exit;
|
if not CheckDirectoryCache then exit('');
|
||||||
Result:=DirectoryCache.FindUnitSourceInCompletePath(
|
Result:=DirectoryCache.FindUnitSourceInCompletePath(
|
||||||
AnUnitName,AnUnitInFilename,true);
|
AnUnitName,AnUnitInFilename,true);
|
||||||
end;
|
end;
|
||||||
|
@ -431,7 +431,7 @@ end;
|
|||||||
|
|
||||||
function TLFMTree.ParseIfNeeded: boolean;
|
function TLFMTree.ParseIfNeeded: boolean;
|
||||||
begin
|
begin
|
||||||
if not UpdateNeeded then exit;
|
if not UpdateNeeded then exit(true);
|
||||||
Result:=Parse(LFMBuffer);
|
Result:=Parse(LFMBuffer);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ function TResourceCodeTool.FindLazarusResourceHeaderComment(
|
|||||||
begin
|
begin
|
||||||
Result.StartPos:=-1;
|
Result.StartPos:=-1;
|
||||||
Result.EndPos:=-1;
|
Result.EndPos:=-1;
|
||||||
|
Result.Flag:=cafNone;
|
||||||
SetSource(ResourceCode);
|
SetSource(ResourceCode);
|
||||||
|
|
||||||
Result.StartPos:=FindNextNonSpace(Src,1);
|
Result.StartPos:=FindNextNonSpace(Src,1);
|
||||||
|
@ -1400,6 +1400,8 @@ var LinkIndex: integer;
|
|||||||
CurCode: TCodeBuffer;
|
CurCode: TCodeBuffer;
|
||||||
begin
|
begin
|
||||||
Result.StartPos:=-1;
|
Result.StartPos:=-1;
|
||||||
|
Result.EndPos:=-1;
|
||||||
|
Result.Flag:=cafNone;
|
||||||
LinkIndex:=-1;
|
LinkIndex:=-1;
|
||||||
CurCode:=FindNextIncludeInInitialization(LinkIndex);
|
CurCode:=FindNextIncludeInInitialization(LinkIndex);
|
||||||
while (CurCode<>nil) do begin
|
while (CurCode<>nil) do begin
|
||||||
|
@ -3301,7 +3301,7 @@ end;
|
|||||||
|
|
||||||
function TDBGCallStack.InternalGetEntry(AIndex: Integer): TCallStackEntry;
|
function TDBGCallStack.InternalGetEntry(AIndex: Integer): TCallStackEntry;
|
||||||
begin
|
begin
|
||||||
if FEntries.GetData(AIndex, Result) then Exit;
|
if FEntries.GetData(AIndex, Result) then Exit(nil);
|
||||||
|
|
||||||
Result := CreateStackEntry(AIndex);
|
Result := CreateStackEntry(AIndex);
|
||||||
if Result = nil then Exit;
|
if Result = nil then Exit;
|
||||||
|
@ -655,6 +655,7 @@ function TDesignerMainMenu.GetMaxCoordinates(DesignerMenuItem: PDesignerMenuItem
|
|||||||
var
|
var
|
||||||
temp_coord: TRect;
|
temp_coord: TRect;
|
||||||
begin
|
begin
|
||||||
|
Result:=Rect(0,0,0,0);
|
||||||
if (DesignerMenuItem^.coord.Right > Max_Width) then
|
if (DesignerMenuItem^.coord.Right > Max_Width) then
|
||||||
Max_Width:=DesignerMenuItem^.coord.Right;
|
Max_Width:=DesignerMenuItem^.coord.Right;
|
||||||
if (DesignerMenuItem^.coord.Bottom > Max_Height) then
|
if (DesignerMenuItem^.coord.Bottom > Max_Height) then
|
||||||
|
@ -1123,7 +1123,7 @@ var
|
|||||||
ChildNode: TTreeNode;
|
ChildNode: TTreeNode;
|
||||||
HasVisibleChilds: Boolean;
|
HasVisibleChilds: Boolean;
|
||||||
begin
|
begin
|
||||||
if ANode=nil then exit;
|
if ANode=nil then exit(false);
|
||||||
ChildNode:=ANode.GetFirstChild;
|
ChildNode:=ANode.GetFirstChild;
|
||||||
HasVisibleChilds:=false;
|
HasVisibleChilds:=false;
|
||||||
while ChildNode<>nil do begin
|
while ChildNode<>nil do begin
|
||||||
|
@ -1391,7 +1391,7 @@ function TCodeToolsDefinesEditor.ConsistencyCheck: integer;
|
|||||||
function CheckNode(ATreeNode: TTreeNode): integer;
|
function CheckNode(ATreeNode: TTreeNode): integer;
|
||||||
var ADefNode, DummyDefNode: TDefineTemplate;
|
var ADefNode, DummyDefNode: TDefineTemplate;
|
||||||
begin
|
begin
|
||||||
if ATreeNode=nil then exit;
|
if ATreeNode=nil then exit(0);
|
||||||
ADefNode:=TDefineTemplate(ATreeNode.Data);
|
ADefNode:=TDefineTemplate(ATreeNode.Data);
|
||||||
//writeln(' CheckNode "',ATreeNode.Text,'" "',ADefNode.Name,'"');
|
//writeln(' CheckNode "',ATreeNode.Text,'" "',ADefNode.Name,'"');
|
||||||
if ADefNode=nil then begin
|
if ADefNode=nil then begin
|
||||||
|
@ -1985,7 +1985,7 @@ var
|
|||||||
OldBreakPoint: TIDEBreakPoint;
|
OldBreakPoint: TIDEBreakPoint;
|
||||||
begin
|
begin
|
||||||
OldBreakPoint:=FBreakPoints.Find(AFilename,ALine);
|
OldBreakPoint:=FBreakPoints.Find(AFilename,ALine);
|
||||||
if OldBreakPoint=nil then exit;
|
if OldBreakPoint=nil then exit(mrOk);
|
||||||
OldBreakPoint.Free;
|
OldBreakPoint.Free;
|
||||||
Project1.Modified:=true;
|
Project1.Modified:=true;
|
||||||
Result := mrOK
|
Result := mrOK
|
||||||
|
@ -179,7 +179,7 @@ begin
|
|||||||
if EnvironmentOptions.CheckDiskChangesWithLoading then begin
|
if EnvironmentOptions.CheckDiskChangesWithLoading then begin
|
||||||
CheckUnitsWithLoading;
|
CheckUnitsWithLoading;
|
||||||
CheckPackagesWithLoading;
|
CheckPackagesWithLoading;
|
||||||
if ListsAreEmpty then exit;
|
if ListsAreEmpty then exit(mrIgnore);
|
||||||
end;
|
end;
|
||||||
DiskDiffsDlg:=TDiskDiffsDlg.Create(nil);
|
DiskDiffsDlg:=TDiskDiffsDlg.Create(nil);
|
||||||
DiskDiffsDlg.UnitList:=AnUnitList;
|
DiskDiffsDlg.UnitList:=AnUnitList;
|
||||||
|
@ -1252,7 +1252,7 @@ begin
|
|||||||
BaseURL:='';
|
BaseURL:='';
|
||||||
HTMLHint:='';
|
HTMLHint:='';
|
||||||
Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
|
Code:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
|
||||||
if Code=nil then exit;
|
if Code=nil then exit(shrHelpNotFound);
|
||||||
if CodeHelpBoss.GetHTMLHint(Code,CodePos.X,CodePos.Y,true,
|
if CodeHelpBoss.GetHTMLHint(Code,CodePos.X,CodePos.Y,true,
|
||||||
BaseURL,HTMLHint,CacheWasUsed)=chprSuccess
|
BaseURL,HTMLHint,CacheWasUsed)=chprSuccess
|
||||||
then
|
then
|
||||||
|
@ -12522,7 +12522,7 @@ var
|
|||||||
ActiveUnitInfo: TUnitInfo;
|
ActiveUnitInfo: TUnitInfo;
|
||||||
LogCaretXY: TPoint;
|
LogCaretXY: TPoint;
|
||||||
begin
|
begin
|
||||||
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit;
|
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit(false);
|
||||||
{$IFDEF IDE_DEBUG}
|
{$IFDEF IDE_DEBUG}
|
||||||
writeln('');
|
writeln('');
|
||||||
writeln('[TMainIDE.DoInitIdentCompletion] ************');
|
writeln('[TMainIDE.DoInitIdentCompletion] ************');
|
||||||
@ -12544,7 +12544,7 @@ var
|
|||||||
ActiveSrcEdit: TSourceEditor;
|
ActiveSrcEdit: TSourceEditor;
|
||||||
ActiveUnitInfo: TUnitInfo;
|
ActiveUnitInfo: TUnitInfo;
|
||||||
begin
|
begin
|
||||||
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit;
|
if not BeginCodeTool(ActiveSrcEdit,ActiveUnitInfo,[]) then exit(false);
|
||||||
{$IFDEF IDE_DEBUG}
|
{$IFDEF IDE_DEBUG}
|
||||||
writeln('');
|
writeln('');
|
||||||
writeln('[TMainIDE.DoShowCodeContext] ************');
|
writeln('[TMainIDE.DoShowCodeContext] ************');
|
||||||
|
@ -555,7 +555,7 @@ end;
|
|||||||
|
|
||||||
function TSourceMarks.Add(AMark: TSourceMark): integer;
|
function TSourceMarks.Add(AMark: TSourceMark): integer;
|
||||||
begin
|
begin
|
||||||
if AMark=nil then exit;
|
if AMark=nil then exit(-1);
|
||||||
Result:=fItems.Add(AMark);
|
Result:=fItems.Add(AMark);
|
||||||
fSortedItems.Add(AMark);
|
fSortedItems.Add(AMark);
|
||||||
AMark.FSourceMarks:=Self;
|
AMark.FSourceMarks:=Self;
|
||||||
|
@ -601,7 +601,9 @@ end;
|
|||||||
function TIDETextConverter.GetTempFilename: string;
|
function TIDETextConverter.GetTempFilename: string;
|
||||||
begin
|
begin
|
||||||
if TextConverterToolClasses<>nil then
|
if TextConverterToolClasses<>nil then
|
||||||
Result:=TextConverterToolClasses.GetTempFilename;
|
Result:=TextConverterToolClasses.GetTempFilename
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
if Result='' then
|
if Result='' then
|
||||||
Result:='temp.txt';
|
Result:='temp.txt';
|
||||||
end;
|
end;
|
||||||
|
@ -1490,7 +1490,6 @@ end;
|
|||||||
function NormalizarRect(const R:TRect): TRect;
|
function NormalizarRect(const R:TRect): TRect;
|
||||||
begin
|
begin
|
||||||
Result.Left:=Min(R.Left, R.Right);
|
Result.Left:=Min(R.Left, R.Right);
|
||||||
|
|
||||||
Result.Top:=Min(R.Top, R.Bottom);
|
Result.Top:=Min(R.Top, R.Bottom);
|
||||||
Result.Right:=Max(R.Left, R.Right);
|
Result.Right:=Max(R.Left, R.Right);
|
||||||
Result.Bottom:=Max(R.Top, R.Bottom);
|
Result.Bottom:=Max(R.Top, R.Bottom);
|
||||||
@ -4398,6 +4397,7 @@ function TCustomGrid.ColRowToOffset(IsCol, Relative: Boolean; Index:Integer;
|
|||||||
var
|
var
|
||||||
Dim: Integer;
|
Dim: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result:=false;
|
||||||
with FGCache do begin
|
with FGCache do begin
|
||||||
if IsCol then begin
|
if IsCol then begin
|
||||||
StartPos:=integer(PtrUInt(AccumWidth[index]));
|
StartPos:=integer(PtrUInt(AccumWidth[index]));
|
||||||
|
@ -747,6 +747,7 @@ begin
|
|||||||
if CanReadFromCache then
|
if CanReadFromCache then
|
||||||
Result:=FCount
|
Result:=FCount
|
||||||
else begin
|
else begin
|
||||||
|
Result:=0;
|
||||||
if ClipboardGetFormats(ClipboardType,Result,List) then begin
|
if ClipboardGetFormats(ClipboardType,Result,List) then begin
|
||||||
if List<>nil then FreeMem(List);
|
if List<>nil then FreeMem(List);
|
||||||
end else
|
end else
|
||||||
|
@ -348,7 +348,7 @@ var
|
|||||||
function Breakable(Breaks : TList; Index : Integer) : Boolean;
|
function Breakable(Breaks : TList; Index : Integer) : Boolean;
|
||||||
begin
|
begin
|
||||||
If not Assigned(Breaks) then
|
If not Assigned(Breaks) then
|
||||||
exit;
|
exit(false);
|
||||||
Result := Breaks.IndexOf(Pointer(PtrInt(Index))) <> -1;
|
Result := Breaks.IndexOf(Pointer(PtrInt(Index))) <> -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -106,14 +106,14 @@ begin
|
|||||||
// ToDo: Eventually there must be a 'before paint message'.
|
// ToDo: Eventually there must be a 'before paint message'.
|
||||||
if IsAfterGtk then
|
if IsAfterGtk then
|
||||||
begin
|
begin
|
||||||
if TObject(Target) is TCustomControl then exit;
|
if TObject(Target) is TCustomControl then exit(false);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
if not (TObject(Target) is TCustomControl) then exit;
|
if not (TObject(Target) is TCustomControl) then exit(false);
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
if (not RepaintAll) and ((Area^.Width<1) or (Area^.Height<1)) then exit;
|
if (not RepaintAll) and ((Area^.Width<1) or (Area^.Height<1)) then exit(false);
|
||||||
|
|
||||||
MSG.Msg := LM_GTKPAINT;
|
MSG.Msg := LM_GTKPAINT;
|
||||||
MSG.Data := TLMGtkPaintData.Create;
|
MSG.Data := TLMGtkPaintData.Create;
|
||||||
|
@ -942,7 +942,7 @@ function TGtkWidgetSet.AddProcessEventHandler(AHandle: THandle;
|
|||||||
var
|
var
|
||||||
lHandler: PChildSignalEventHandler;
|
lHandler: PChildSignalEventHandler;
|
||||||
begin
|
begin
|
||||||
if AEventHandler = nil then exit;
|
if AEventHandler = nil then exit(nil);
|
||||||
New(lHandler);
|
New(lHandler);
|
||||||
lHandler^.PID := TPid(AHandle);
|
lHandler^.PID := TPid(AHandle);
|
||||||
lHandler^.UserData := AData;
|
lHandler^.UserData := AData;
|
||||||
|
@ -865,6 +865,7 @@ var
|
|||||||
PS : PPaintStruct;
|
PS : PPaintStruct;
|
||||||
Widget: PGtkWidget;
|
Widget: PGtkWidget;
|
||||||
begin
|
begin
|
||||||
|
FillByte(Result,SizeOf(Result),0);
|
||||||
Result.Msg := LM_PAINT;
|
Result.Msg := LM_PAINT;
|
||||||
New(PS);
|
New(PS);
|
||||||
FillChar(PS^, SizeOf(TPaintStruct), 0);
|
FillChar(PS^, SizeOf(TPaintStruct), 0);
|
||||||
@ -5292,7 +5293,7 @@ end;
|
|||||||
function SetAccelKey(const Widget: PGtkWidget;
|
function SetAccelKey(const Widget: PGtkWidget;
|
||||||
Key: guint; Mods: TGdkModifierType; const Signal: string): PAcceleratorKey;
|
Key: guint; Mods: TGdkModifierType; const Signal: string): PAcceleratorKey;
|
||||||
begin
|
begin
|
||||||
if (Widget = nil) then exit;
|
if (Widget = nil) then exit(nil);
|
||||||
Result:=GetAccelKey(Widget);
|
Result:=GetAccelKey(Widget);
|
||||||
if Result=nil then begin
|
if Result=nil then begin
|
||||||
if Key>0 then begin
|
if Key>0 then begin
|
||||||
@ -9473,6 +9474,7 @@ function GetWindowFunction(AForm : TCustomForm) : Longint;
|
|||||||
var
|
var
|
||||||
ABorderStyle: TFormBorderStyle;
|
ABorderStyle: TFormBorderStyle;
|
||||||
begin
|
begin
|
||||||
|
Result:=0;
|
||||||
if not (csDesigning in AForm.ComponentState) then
|
if not (csDesigning in AForm.ComponentState) then
|
||||||
ABorderStyle:=AForm.BorderStyle
|
ABorderStyle:=AForm.BorderStyle
|
||||||
else
|
else
|
||||||
|
@ -198,6 +198,7 @@ var
|
|||||||
DevCtx: TGtkDeviceContext absolute DC;
|
DevCtx: TGtkDeviceContext absolute DC;
|
||||||
ClientWidget: PGtkWidget;
|
ClientWidget: PGtkWidget;
|
||||||
begin
|
begin
|
||||||
|
FillByte(Result,SizeOf(Result),0);
|
||||||
Result.Style := nil;
|
Result.Style := nil;
|
||||||
if not GTKWidgetSet.IsValidDC(DC) then Exit;
|
if not GTKWidgetSet.IsValidDC(DC) then Exit;
|
||||||
|
|
||||||
|
@ -8543,7 +8543,7 @@ var
|
|||||||
NewTopLevelObject: TObject;
|
NewTopLevelObject: TObject;
|
||||||
NewForm: TCustomForm;
|
NewForm: TCustomForm;
|
||||||
begin
|
begin
|
||||||
if hWnd=0 then exit;
|
if hWnd=0 then exit(0);
|
||||||
Widget:=PGtkWidget(hWnd);
|
Widget:=PGtkWidget(hWnd);
|
||||||
{$IfDef VerboseFocus}
|
{$IfDef VerboseFocus}
|
||||||
DebugLn('');
|
DebugLn('');
|
||||||
|
@ -755,6 +755,7 @@ var
|
|||||||
Iter: TGtkTreeIter;
|
Iter: TGtkTreeIter;
|
||||||
AValue: gboolean;
|
AValue: gboolean;
|
||||||
begin
|
begin
|
||||||
|
Result:=false;
|
||||||
if not WSCheckHandleAllocated(ALV, 'ItemGetChecked')
|
if not WSCheckHandleAllocated(ALV, 'ItemGetChecked')
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
|
@ -303,6 +303,7 @@ var
|
|||||||
Group: PGSList;
|
Group: PGSList;
|
||||||
Item: Pointer;
|
Item: Pointer;
|
||||||
begin
|
begin
|
||||||
|
Result:=false;
|
||||||
if not WSCheckMenuItem(AMenuItem, 'SetCheck') then
|
if not WSCheckMenuItem(AMenuItem, 'SetCheck') then
|
||||||
Exit;
|
Exit;
|
||||||
Item := Pointer(AMenuItem.Handle);
|
Item := Pointer(AMenuItem.Handle);
|
||||||
|
@ -736,6 +736,7 @@ class function TGtk2WSCustomListBox.GetStrings(
|
|||||||
var
|
var
|
||||||
Widget: PGtkWidget;// pointer to gtk-widget
|
Widget: PGtkWidget;// pointer to gtk-widget
|
||||||
begin
|
begin
|
||||||
|
Result:=nil;
|
||||||
if not WSCheckHandleAllocated(ACustomListBox, 'GetStrings') then
|
if not WSCheckHandleAllocated(ACustomListBox, 'GetStrings') then
|
||||||
Exit;
|
Exit;
|
||||||
case ACustomListBox.fCompStyle of
|
case ACustomListBox.fCompStyle of
|
||||||
|
@ -658,6 +658,7 @@ end;
|
|||||||
function QueryDescription(AFlags: TRawImageQueryFlags; AWidth: Integer = -1; AHeight: integer = -1): TRawImageDescription;
|
function QueryDescription(AFlags: TRawImageQueryFlags; AWidth: Integer = -1; AHeight: integer = -1): TRawImageDescription;
|
||||||
begin
|
begin
|
||||||
Exclude(AFlags, riqfUpdate);
|
Exclude(AFlags, riqfUpdate);
|
||||||
|
Result.Init;
|
||||||
QueryDescription(Result, AFlags, AWidth, AHeight);
|
QueryDescription(Result, AFlags, AWidth, AHeight);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -671,7 +672,6 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
if not (riqfUpdate in AFlags) then ADesc.Init;
|
if not (riqfUpdate in AFlags) then ADesc.Init;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetDescriptionFromDevice(ADC: HDC; AWidth, AHeight: integer): TRawImageDescription;
|
function GetDescriptionFromDevice(ADC: HDC; AWidth, AHeight: integer): TRawImageDescription;
|
||||||
@ -698,9 +698,10 @@ function AddAlphaToDescription(var ADesc: TRawImageDescription; APrec: Byte): Bo
|
|||||||
var
|
var
|
||||||
Mask: Cardinal;
|
Mask: Cardinal;
|
||||||
begin
|
begin
|
||||||
if ADesc.AlphaPrec >= APrec then Exit(False);
|
Result:=false;
|
||||||
if ADesc.BitsPerPixel <> 32 then Exit(False);
|
if ADesc.AlphaPrec >= APrec then Exit;
|
||||||
if ADesc.Depth <> 24 then Exit(False);
|
if ADesc.BitsPerPixel <> 32 then Exit;
|
||||||
|
if ADesc.Depth <> 24 then Exit;
|
||||||
|
|
||||||
Mask := CreateBitMask(ADesc.RedShift, ADesc.RedPrec)
|
Mask := CreateBitMask(ADesc.RedShift, ADesc.RedPrec)
|
||||||
or CreateBitMask(ADesc.GreenShift, ADesc.GreenPrec)
|
or CreateBitMask(ADesc.GreenShift, ADesc.GreenPrec)
|
||||||
|
@ -2910,7 +2910,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if SrcI >= SrcCharCount then
|
if SrcI >= SrcCharCount then
|
||||||
if UnfinishedCharError then Exit
|
if UnfinishedCharError then Exit(trInvalidChar)
|
||||||
else Break;
|
else Break;
|
||||||
|
|
||||||
B2 := Byte(Src[SrcI]);
|
B2 := Byte(Src[SrcI]);
|
||||||
@ -2924,12 +2924,12 @@ begin
|
|||||||
Inc(DestI);
|
Inc(DestI);
|
||||||
end
|
end
|
||||||
else // invalid character, assume single byte UTF-8 char
|
else // invalid character, assume single byte UTF-8 char
|
||||||
if InvalidCharError(1) then Exit;
|
if InvalidCharError(1) then Exit(trInvalidChar);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if SrcI >= SrcCharCount then
|
if SrcI >= SrcCharCount then
|
||||||
if UnfinishedCharError then Exit
|
if UnfinishedCharError then Exit(trInvalidChar)
|
||||||
else Break;
|
else Break;
|
||||||
|
|
||||||
B3 := Byte(Src[SrcI]);
|
B3 := Byte(Src[SrcI]);
|
||||||
@ -2955,12 +2955,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else // invalid character, assume single byte UTF-8 char
|
else // invalid character, assume single byte UTF-8 char
|
||||||
if InvalidCharError(2) then Exit;
|
if InvalidCharError(2) then Exit(trInvalidChar);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if SrcI >= SrcCharCount then
|
if SrcI >= SrcCharCount then
|
||||||
if UnfinishedCharError then Exit
|
if UnfinishedCharError then Exit(trInvalidChar)
|
||||||
else Break;
|
else Break;
|
||||||
|
|
||||||
B4 := Byte(Src[SrcI]);
|
B4 := Byte(Src[SrcI]);
|
||||||
@ -2979,7 +2979,7 @@ begin
|
|||||||
Inc(DestI);
|
Inc(DestI);
|
||||||
end
|
end
|
||||||
else // invalid character, assume single byte UTF-8 char
|
else // invalid character, assume single byte UTF-8 char
|
||||||
if InvalidCharError(3) then Exit;
|
if InvalidCharError(3) then Exit(trInvalidChar);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3115,7 +3115,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if SrcI >= SrcWideCharCount then
|
if SrcI >= SrcWideCharCount then
|
||||||
if UnfinishedCharError then Exit
|
if UnfinishedCharError then Exit(trInvalidChar)
|
||||||
else Break;
|
else Break;
|
||||||
|
|
||||||
W2 := Word(Src[SrcI]);
|
W2 := Word(Src[SrcI]);
|
||||||
@ -3155,13 +3155,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else // invalid character, assume single wide char UTF-16 char
|
else // invalid character, assume single wide char UTF-16 char
|
||||||
if InvalidCharError(1) then Exit;
|
if InvalidCharError(1) then Exit(trInvalidChar);
|
||||||
end
|
end
|
||||||
else // invalid character, assume single wide char UTF-16 char
|
else // invalid character, assume single wide char UTF-16 char
|
||||||
if InvalidCharError(1) then Exit;
|
if InvalidCharError(1) then Exit(trInvalidChar);
|
||||||
end
|
end
|
||||||
else // invalid character, assume single wide char UTF-16 char
|
else // invalid character, assume single wide char UTF-16 char
|
||||||
if InvalidCharError(1) then Exit;
|
if InvalidCharError(1) then Exit(trInvalidChar);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1533,6 +1533,7 @@ begin
|
|||||||
dvaInt32:
|
dvaInt32:
|
||||||
Read(Result, SizeOf(Result));
|
Read(Result, SizeOf(Result));
|
||||||
else
|
else
|
||||||
|
Result:=0;
|
||||||
PropValueError;
|
PropValueError;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1745,6 +1746,7 @@ begin
|
|||||||
dvaNull:
|
dvaNull:
|
||||||
Result := 'Null';
|
Result := 'Null';
|
||||||
else
|
else
|
||||||
|
Result:='';
|
||||||
PropValueError;
|
PropValueError;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -3728,6 +3730,9 @@ begin
|
|||||||
Result := 'True';
|
Result := 'True';
|
||||||
vaNull:
|
vaNull:
|
||||||
Result := 'Null';
|
Result := 'Null';
|
||||||
|
else
|
||||||
|
Result:='';
|
||||||
|
RaiseGDBException('');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3824,7 +3829,6 @@ begin
|
|||||||
Read(Pointer(@Result[1])^, i);
|
Read(Pointer(@Result[1])^, i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TLRSObjectReader.ReadWideString: WideString;
|
function TLRSObjectReader.ReadWideString: WideString;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
@ -1985,7 +1985,7 @@ end;
|
|||||||
|
|
||||||
function TPackageEditorForm.CanBeAddedToProject: boolean;
|
function TPackageEditorForm.CanBeAddedToProject: boolean;
|
||||||
begin
|
begin
|
||||||
if LazPackage=nil then exit;
|
if LazPackage=nil then exit(false);
|
||||||
Result:=PackageEditors.AddToProject(LazPackage,true)=mrOk;
|
Result:=PackageEditors.AddToProject(LazPackage,true)=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ function TPkgManager.OnPackageEditorRevertPackage(Sender: TObject;
|
|||||||
begin
|
begin
|
||||||
if APackage.AutoCreated or (not FilenameIsAbsolute(APackage.Filename))
|
if APackage.AutoCreated or (not FilenameIsAbsolute(APackage.Filename))
|
||||||
or (not FileExists(APackage.Filename)) then
|
or (not FileExists(APackage.Filename)) then
|
||||||
exit;
|
exit(mrCancel);
|
||||||
Result:=DoOpenPackageFile(APackage.Filename,[pofRevert]);
|
Result:=DoOpenPackageFile(APackage.Filename,[pofRevert]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -918,7 +918,7 @@ end;
|
|||||||
function TPkgManager.PackageGraphExplorerOpenProject(Sender: TObject;
|
function TPkgManager.PackageGraphExplorerOpenProject(Sender: TObject;
|
||||||
AProject: TProject): TModalResult;
|
AProject: TProject): TModalResult;
|
||||||
begin
|
begin
|
||||||
if AProject<>Project1 then exit;
|
if AProject<>Project1 then exit(mrCancel);
|
||||||
Result:=MainIDE.DoShowProjectInspector;
|
Result:=MainIDE.DoShowProjectInspector;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user