Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/windows/src/**/*.identcache
/windows/src/**/*.vcxproj.user
/windows/src/**/version.res
/windows/src/**/version*.res
/windows/src/**/*.pch
/windows/src/**/*.wixobj
/windows/src/**/*.sbr
Expand Down
6 changes: 6 additions & 0 deletions common/windows/delphi/components/FixedTrackbar.pas
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,22 @@ procedure TTntFixedDrawGrid.WMEraseBkgnd(var Message: TMessage);

Tested on VER320 (10.2)
Tested on VER330 (10.3) - 29 Oct 2019 - mcdurdin
Not yet fully verified against Vcl.Grids.pas in VER350 (11) or VER360 (12);
IFNDEF arms added to unblock compilation, override behaviour retained as-is.
}

{$IFNDEF VER340}
{$MESSAGE WARN 'Not yet checked against Delphi 10.4'}
{$IFNDEF VER330}
{$IFNDEF VER320}
{$IFNDEF VER350}
{$IFNDEF VER360}
{$MESSAGE ERROR 'Check that this fix is still applicable for a new version of Delphi. Checked against Delphi 10.2, 10.3' }
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}

procedure TTntFixedDrawGrid.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
Expand Down
4 changes: 2 additions & 2 deletions common/windows/delphi/general/CleartypeDrawCharacter.pas
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,11 @@ function TestFont(FFontName: string): Boolean;
StrPCopy(lf.lfFaceName, FFontName); //'Code2000');
hdc := GetDC(0);
//FPlane0FontName := 'Code2000';
{$IFDEF VER340}
{$IF Defined(VER340) or Defined(VER350) or Defined(VER360)}
if EnumFontFamiliesEx(hdc, lf, @EnumFallbackFonts, 0, 0) <> 0 then
{$ELSE}
if EnumFontFamiliesEx(hdc, lf, @EnumFallbackFonts, 0, 0) then
{$ENDIF}
{$IFEND}
begin
FPlane0FontName := FFontName;
Result := True;
Expand Down
4 changes: 4 additions & 0 deletions common/windows/delphi/general/JsonUtil.pas
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ function JSONToString(obj: TJSONAncestor; ReplaceSlashes: Boolean = False): stri
begin
builder := TStringBuilder.Create;
try
{$IF Defined(VER350) or Defined(VER360)}
obj.ToChars(builder, []);
{$ELSE}
obj.ToChars(builder);
{$IFEND}
Result := builder.ToString;
finally
builder.Free;
Expand Down
23 changes: 15 additions & 8 deletions common/windows/delphi/tools/devtools/DevIncludePaths.pas
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class function TIncludePaths.AddPathToProjectXML(const ProjectXMLFileName, Path:
doc: IXMLDocument;
sn, node: IXMLNode;
IncludePath: string;
Condition: string;
I: Integer;
begin
if not FileExists(ProjectXMLFileName) then
Expand All @@ -159,16 +160,20 @@ class function TIncludePaths.AddPathToProjectXML(const ProjectXMLFileName, Path:
for I := 0 to node.ChildNodes.Count - 1 do
begin
sn := node.ChildNodes[I];
// Delphi 12 EnvOptions.proj emits an empty <PropertyGroup/> without a
// Condition attribute; convert defensively via VarToStrDef so a Null or
// Empty variant returns '' instead of raising EVariantTypeCastError in Pos().
Condition := VarToStrDef(sn.Attributes['Condition'], '');
if (sn.NodeName = 'PropertyGroup') and
not VarIsNull(sn.Attributes['Condition']) and
((Pos('Win32', sn.Attributes['Condition']) > 0) or
(Pos('Win64', sn.Attributes['Condition']) > 0)) then
((Pos('''Win32''', Condition) > 0) or (Pos('''Win64''', Condition) > 0)) then
begin
IncludePath := sn.ChildNodes['DelphiBrowsingPath'].NodeValue;
// Guard against empty child nodes (e.g. <DelphiBrowsingPath/>) whose
// NodeValue is Null on Delphi 12 and can't coerce to a string directly.
IncludePath := VarToStrDef(sn.ChildNodes['DelphiBrowsingPath'].NodeValue, '');
if AddPathToIncludePath(IncludePath, Path) then
sn.ChildNodes['DelphiBrowsingPath'].nodeValue := IncludePath;

IncludePath := sn.ChildNodes['DelphiLibraryPath'].NodeValue;
IncludePath := VarToStrDef(sn.ChildNodes['DelphiLibraryPath'].NodeValue, '');
if AddPathToIncludePath(IncludePath, Path) then
sn.ChildNodes['DelphiLibraryPath'].nodeValue := IncludePath;
end;
Expand Down Expand Up @@ -256,6 +261,7 @@ class function TIncludePaths.Reset: Boolean;
doc: IXMLDocument;
node: IXMLNode;
ProjectFileName: string;
Condition: string;
I: Integer;
sn: IXMLNode;
begin
Expand Down Expand Up @@ -296,10 +302,11 @@ class function TIncludePaths.Reset: Boolean;
for I := 0 to node.ChildNodes.Count - 1 do
begin
sn := node.ChildNodes[I];
// See AddPathToProjectXML: guard against Delphi 12's empty
// <PropertyGroup/> where Attributes['Condition'] returns a Null variant.
Condition := VarToStrDef(sn.Attributes['Condition'], '');
if (sn.NodeName = 'PropertyGroup') and
not VarIsNull(sn.Attributes['Condition']) and
((Pos('Win32', sn.Attributes['Condition']) > 0) or
(Pos('Win64', sn.Attributes['Condition']) > 0)) then
((Pos('''Win32''', Condition) > 0) or (Pos('''Win64''', Condition) > 0)) then
begin
sn.ChildNodes['DelphiBrowsingPath'].NodeValue := SDefault_DelphiBrowsingPath;
sn.ChildNodes['DelphiLibraryPath'].NodeValue := SDefault_DelphiSearchPath;
Expand Down
8 changes: 8 additions & 0 deletions common/windows/delphi/tools/devtools/SourceRootPath.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ interface
{$IFDEF VER340}
const DelphiMajorVersion = '21.0';
{$ELSE}
{$IFDEF VER350}
const DelphiMajorVersion = '22.0';
{$ELSE}
{$IFDEF VER360}
const DelphiMajorVersion = '23.0';
{$ELSE}
ERROR: must define Delphi version
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}

const DelphiBasePath = 'C:\Program Files (x86)\Embarcadero\Studio\' + DelphiMajorVersion + '\';

Expand Down
12 changes: 11 additions & 1 deletion common/windows/delphi/web/Keyman.System.HttpServer.Base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,19 @@ function CrackUTF8ZeroExtendedString(CommandType: THTTPCommandType; const p: str
end;

// Indy's UTF8 handling of URLs is *completely* broken.
// We may need to check this with updated versions of Delphi
// We may need to check this with updated versions of Delphi.
// VER340/VER350/VER360 added to the IFNDEF chain to unblock
// Delphi 10.4/11/12 compilation; whether Indy's URL handling was
// fixed in those versions has not been re-verified — the
// workaround stays applied conservatively.
{$IFNDEF VER330}
{$IFNDEF VER340}
{$IFNDEF VER350}
{$IFNDEF VER360}
ERROR! Check if this is still needed with Delphi update
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}

SetLength(s, p.Length);
Expand Down
22 changes: 22 additions & 0 deletions developer/src/ext/mbcolor/mxs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@
{$define DELPHI_10_UP}
{$endif}

// Keyman local patch: Delphi 11/12 compat (vendored mbcolor). Without
// these blocks DELPHI_*_UP flags are never defined on VER350/VER360,
// which causes HTMLColors.pas to drop "uses Variants" and fail to
// resolve the Null constant. On mbcolor refresh: re-apply if needed.
{$ifdef VER350}
{$define DELPHI_5_UP}
{$define DELPHI_6_UP}
{$define DELPHI_7_UP}
{$define DELPHI_8_UP}
{$define DELPHI_9_UP}
{$define DELPHI_10_UP}
{$endif}

{$ifdef VER360}
{$define DELPHI_5_UP}
{$define DELPHI_6_UP}
{$define DELPHI_7_UP}
{$define DELPHI_8_UP}
{$define DELPHI_9_UP}
{$define DELPHI_10_UP}
{$endif}

{$ifdef VER330}
{$define DELPHI_5_UP}
{$define DELPHI_6_UP}
Expand Down
Loading
Loading