diff --git a/designer/anchoreditor.pas b/designer/anchoreditor.pas index 9cbb9eacef..3dde6e9e63 100644 --- a/designer/anchoreditor.pas +++ b/designer/anchoreditor.pas @@ -683,11 +683,12 @@ var function NeighbourPosition(c: TControl): Integer; begin + result:=0; case CurNeighbour of - akTop: result:=c.top; - akLeft: result:=c.Left; - akRight: result:=c.left+c.Width; - akBottom: result:=c.Top+c.Height; + akTop: result:=c.top; + akLeft: result:=c.Left; + akRight: result:=c.left+c.Width; + akBottom: result:=c.Top+c.Height; end; end; @@ -994,6 +995,7 @@ end; function TAnchorDesigner.AnchorDesignerNeighbourText(direction: TAnchorKind): string; begin + result:=''; case direction of akLeft: result:=lisSelectedLeftNeighbour; akRight: result:=lisSelectedRightNeighbour; diff --git a/designer/menushortcuts.pas b/designer/menushortcuts.pas index d3918cf18c..807b25d5d3 100644 --- a/designer/menushortcuts.pas +++ b/designer/menushortcuts.pas @@ -463,7 +463,8 @@ end; function KindToPropertyName(aKind: TSCKind): string; begin - case aKind of + Result:=''; + case aKind of scUnknown: Result:=''; scActionAccel, scMenuItemAccel, scOtherCompAccel: Result:='Caption'; diff --git a/ide/buildprofilemanager.pas b/ide/buildprofilemanager.pas index 7990efc04f..662ea82549 100644 --- a/ide/buildprofilemanager.pas +++ b/ide/buildprofilemanager.pas @@ -174,6 +174,7 @@ const function IdeBuildModeToStr(BuildMode: TIdeBuildMode): string; begin + Result:=''; case BuildMode of bmBuild: Result:='Build'; bmCleanBuild: Result:='Clean + Build'; diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index 60dbb7c35b..588d75db63 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -2060,6 +2060,7 @@ end; function TBaseCompilerOptions.GetTargetFileExt: string; begin + Result:=''; case ExecutableType of cetProgram: Result:=GetExecutableExt(fTargetOS); @@ -3854,16 +3855,17 @@ end; function TAdditionalCompilerOptions.GetOption(AnOption: TInheritedCompilerOption ): string; begin + Result:=''; case AnOption of - icoNone: Result:=''; - icoUnitPath: Result:=UnitPath; - icoNamespaces: Result:=Namespaces; - icoIncludePath: Result:=IncludePath; - icoObjectPath: Result:=ObjectPath; - icoLibraryPath: Result:=LibraryPath; - icoSrcPath: Result:=SrcPath; - icoLinkerOptions: Result:=LinkerOptions; - icoCustomOptions: Result:=CustomOptions; + icoNone: Result:=''; + icoUnitPath: Result:=UnitPath; + icoNamespaces: Result:=Namespaces; + icoIncludePath: Result:=IncludePath; + icoObjectPath: Result:=ObjectPath; + icoLibraryPath: Result:=LibraryPath; + icoSrcPath: Result:=SrcPath; + icoLinkerOptions: Result:=LinkerOptions; + icoCustomOptions: Result:=CustomOptions; else RaiseGDBException(''); // inconsistency detected end; diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index fae72f479b..5a16c295cd 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -5082,6 +5082,7 @@ end; function TEditorOptions.GetTrimSpaceName(IndentType: TSynEditStringTrimmingType): string; begin + Result := ''; case IndentType of settLeaveLine: Result := 'LeaveLine'; diff --git a/ide/encloseselectiondlg.pas b/ide/encloseselectiondlg.pas index 5215ae13c4..3c68c61c6d 100644 --- a/ide/encloseselectiondlg.pas +++ b/ide/encloseselectiondlg.pas @@ -78,6 +78,7 @@ implementation function EncloseSelectionTypeDescription(TheType: TEncloseSelectionType): string; begin + Result:=''; case TheType of estTryFinally: Result:='Try..Finally'; estTryExcept: Result:='Try..Except'; diff --git a/ide/fpdoceditwindow.pas b/ide/fpdoceditwindow.pas index 25846a475e..43f1f9dedb 100644 --- a/ide/fpdoceditwindow.pas +++ b/ide/fpdoceditwindow.pas @@ -397,8 +397,8 @@ var LinkTitle: string; LinkSrc: String; begin - if (ShowFPDocLinkEditorDialog(fSourceFilename,DocFile,Link,LinkTitle)<>mrOk) - or (Link='') then exit; + if ShowFPDocLinkEditorDialog(fSourceFilename,DocFile,Link,LinkTitle)<>mrOk then exit; + if Link='' then exit; LinkSrc:=''; diff --git a/ide/inspectchksumchangeddlg.pas b/ide/inspectchksumchangeddlg.pas index d62a1a7ad4..7ed96d380c 100644 --- a/ide/inspectchksumchangeddlg.pas +++ b/ide/inspectchksumchangeddlg.pas @@ -335,6 +335,7 @@ begin if Files<>nil then begin PPUCount:=0; SrcCount:=0; + FileNode:=nil; for i:=0 to Files.Count-1 do begin aFile:=Files[i]; if CompareFileExt(aFile.Filename,'.ppu',false)=0 then diff --git a/ide/main.pp b/ide/main.pp index 4b9858a0d8..e49f30ba37 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -9353,6 +9353,7 @@ begin if OldSource<>NewSource then begin Line:=0; + Col:=0; for i:=1 to length(OldSource) do if (i>length(NewSource)) or (OldSource[i]<>NewSource[i]) then begin @@ -12767,8 +12768,9 @@ var Root: TPersistent; JITMethod: TJITMethod; begin + Result:=false; Root:=GlobalDesignHook.LookupRoot; - if Root=nil then exit(false); + if Root=nil then exit; if TObject(Method.Data)=Root then begin Result:=(Method.Code<>nil) and (Root.MethodName(Method.Code)<>''); end else if IsJITMethod(Method) then begin diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index 0754b85dbe..d46ca5474e 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -3636,6 +3636,7 @@ begin piUnit: DlgCaption := dlgMainViewUnits; piComponent: DlgCaption := dlgMainViewForms; piFrame: DlgCaption := dlgMainViewFrames; + else DlgCaption := ''; end; Result := ShowViewUnitsDlg(ItemList, MultiSelect, MultiSelectCheckedState, DlgCaption, ItemType); end; @@ -6830,7 +6831,9 @@ begin // try loading the ancestor first (unit, lfm and component instance) if AnUnitInfo.UnitResourceFileformat<>nil then - DefAncestorClass:=AnUnitInfo.UnitResourceFileformat.DefaultComponentClass; + DefAncestorClass:=AnUnitInfo.UnitResourceFileformat.DefaultComponentClass + else + DefAncestorClass:=nil; // use TForm as default ancestor if DefAncestorClass=nil then DefAncestorClass:=BaseFormEditor1.StandardDesignerBaseClasses[DesignerBaseClassId_TForm]; @@ -6838,8 +6841,7 @@ begin if (AncestorClass=nil) then begin IgnoreBtnText:=''; if DefAncestorClass<>nil then - IgnoreBtnText:=Format(lisIgnoreUseAsAncestor, [DefAncestorClass.ClassName] - ); + IgnoreBtnText:=Format(lisIgnoreUseAsAncestor, [DefAncestorClass.ClassName]); Result:=LoadComponentDependencyHidden(AnUnitInfo,AncestorClassName, OpenFlags,false,AncestorClass,AncestorUnitInfo,GrandAncestorClass, diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index 44db2959e0..41f3036d4c 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -593,7 +593,7 @@ begin else QtFont.setFamily(UTF16ToUTF8(GetDefaultAppFontName)); - if (LogFont.lfQuality >= Low(QStyleStategy)) and (LogFont.lfQuality <= High(QStyleStategy)) then + if LogFont.lfQuality <= High(QStyleStategy) then QtFont.setStyleStrategy(QStyleStategy[LogFont.lfQuality]); Result := HFONT(QtFont); except @@ -6144,6 +6144,7 @@ begin begin if fnMapMode <> TQtDeviceContext(DC).vMapMode then begin + AWindowExt := Point(0, 0); case fnMapMode of MM_ANISOTROPIC:; // user's choice MM_ISOTROPIC:; // adjusted after each SetViewPortExtEx call (see MSDN for details) diff --git a/lcl/interfaces/qt/qtwsstdctrls.pp b/lcl/interfaces/qt/qtwsstdctrls.pp index 2a4e7a2142..8b1969159a 100644 --- a/lcl/interfaces/qt/qtwsstdctrls.pp +++ b/lcl/interfaces/qt/qtwsstdctrls.pp @@ -1440,6 +1440,7 @@ class function TQtWSCustomComboBox.GetMaxLength( var LineEdit: TQtLineEdit; begin + Result := 0; if not WSCheckHandleAllocated(ACustomComboBox, 'GetMaxLength') then Exit; LineEdit := TQtComboBox(ACustomComboBox.Handle).LineEdit; @@ -1448,9 +1449,7 @@ begin Result := LineEdit.getMaxLength; if Result = QtMaxEditLength then Result := 0; - end - else - Result := 0; + end; end; {------------------------------------------------------------------------------ diff --git a/lcl/interfaces/qt5/qtwinapi.inc b/lcl/interfaces/qt5/qtwinapi.inc index 533b1dec86..e4d5788e6e 100644 --- a/lcl/interfaces/qt5/qtwinapi.inc +++ b/lcl/interfaces/qt5/qtwinapi.inc @@ -588,7 +588,7 @@ begin else QtFont.setFamily(UTF16ToUTF8(GetDefaultAppFontName)); - if (LogFont.lfQuality >= Low(QStyleStategy)) and (LogFont.lfQuality <= High(QStyleStategy)) then + if LogFont.lfQuality <= High(QStyleStategy) then QtFont.setStyleStrategy(QStyleStategy[LogFont.lfQuality]); Result := HFONT(QtFont); except @@ -6014,6 +6014,7 @@ begin begin if fnMapMode <> TQtDeviceContext(DC).vMapMode then begin + AWindowExt := Point(0, 0); case fnMapMode of MM_ANISOTROPIC:; // user's choice MM_ISOTROPIC:; // adjusted after each SetViewPortExtEx call (see MSDN for details) diff --git a/lcl/interfaces/qt5/qtwsstdctrls.pp b/lcl/interfaces/qt5/qtwsstdctrls.pp index c2d9581ede..3b63f50424 100644 --- a/lcl/interfaces/qt5/qtwsstdctrls.pp +++ b/lcl/interfaces/qt5/qtwsstdctrls.pp @@ -1419,6 +1419,7 @@ class function TQtWSCustomComboBox.GetMaxLength( var LineEdit: TQtLineEdit; begin + Result := 0; if not WSCheckHandleAllocated(ACustomComboBox, 'GetMaxLength') then Exit; LineEdit := TQtComboBox(ACustomComboBox.Handle).LineEdit; @@ -1427,9 +1428,7 @@ begin Result := LineEdit.getMaxLength; if Result = QtMaxEditLength then Result := 0; - end - else - Result := 0; + end; end; {------------------------------------------------------------------------------