Skip to content

Commit 90cc0bb

Browse files
committed
Merge branch 'release/4.22.0'
Release v4.22.0
2 parents dd17a64 + 16f0951 commit 90cc0bb

File tree

76 files changed

+1075
-910
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1075
-910
lines changed

Diff for: CHANGELOG.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ Releases are listed in reverse version number order.
66

77
> Note that _CodeSnip_ v4 was developed in parallel with v3 for a while. As a consequence some v3 releases have later release dates than early v4 releases.
88
9-
## Release v4.21.2 of 13 July 2023
9+
## Release v4.22.0 of 08 November 2023
10+
11+
* Added support for test compiling snippets with Delphi 12 Athens [issue #121].
12+
* Documentation changes re addition of support for Delphi 12:
13+
* File format additions for config, export, user database and main database.
14+
* `Docs/ReadMe.txt`.
15+
* Relevant help topics.
16+
* Reversed order in which compilers are listed in the Configure Compilers and Find Compilers dialogue boxes so that the most recent version of Delphi is listed first [issue #51].
17+
* Refactored out all `with` statements from Pascal source code [issue #118].
18+
* Fixed error in `CHANGELOG.md` entry for release v4.21.2 [issue #120].
19+
20+
## Release v4.21.2 of 14 July 2023
1021

1122
* Removed broken links and fixed unsafe links in the About box [issue #105].
12-
* Fixed bug in version information files that resulted in an error in the Comments section of the version information of both editions of _CodeSnip_ [issue 106].
23+
* Fixed bug in version information files that resulted in an error in the Comments section of the version information of both editions of _CodeSnip_ [issue #106].
1324
* Fixed potential XSS vulnerability in JQuery code used in Easter egg [issue #107].
1425
* Documentation changes:
1526
* Rationalised, corrected, updated and clarified licensing information. These changes affected many documentation files. [issue #108].

Diff for: Docs/Design/FileFormats/config.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
66
* obtain one at https://mozilla.org/MPL/2.0/
77
*
8-
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
8+
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
99
*
1010
* CodeSnip File Format Documentation: Configuration Files
1111
-->
@@ -259,6 +259,9 @@ <h4>
259259
<li>
260260
<em>D11A</em> &ndash; Delphi 11.x Alexandria
261261
</li>
262+
<li>
263+
<em>D12Y</em> &ndash; Delphi 12 Athens
264+
</li>
262265
<li>
263266
<em>FPC</em> &ndash; Free Pascal
264267
</li>
@@ -613,6 +616,12 @@ <h4>
613616
<dd>
614617
Indicates whether Delphi 11.x Alexandria was included in the search.
615618
</dd>
619+
<dt>
620+
<code class="key">D12Y</code> (Boolean)
621+
</dt>
622+
<dd>
623+
Indicates whether Delphi 12 Athens was included in the search.
624+
</dd>
616625
<dt>
617626
<code class="key">FPC</code> (Boolean)
618627
</dt>

Diff for: Docs/Design/FileFormats/export.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
66
* obtain one at https://mozilla.org/MPL/2.0/
77
*
8-
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
8+
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
99
*
1010
* CodeSnip File Format Documentation: Export
1111
-->
@@ -606,6 +606,9 @@ <h2>
606606
<li>
607607
<em>d11a</em> &ndash; Delphi 11.x Alexandria compiler <span class="highlight">(v7.2 &amp; later)</span>
608608
</li>
609+
<li>
610+
<em>d12y</em> &ndash; Delphi 12 Athens compiler <span class="highlight">(v7.4 &amp; later)</span>
611+
</li>
609612
<li>
610613
<em>fpc</em> &ndash; Free Pascal compiler <span class="highlight">(all versions)</span>
611614
</li>
@@ -984,6 +987,12 @@ <h2>
984987
<dd>
985988
Updated with CodeSnip v4.21.0 to add support for REML v5, which is backward compatible with REML v4.
986989
</dd>
990+
<dt>
991+
<em>Version 7.4 - 7 November 2023</em>
992+
</dt>
993+
<dd>
994+
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
995+
</dd>
987996
</dl>
988997
</dd>
989998
</dl>

Diff for: Docs/Design/FileFormats/main-db.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
66
* obtain one at https://mozilla.org/MPL/2.0/
77
*
8-
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
8+
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
99
*
1010
* CodeSnip File Format Documentation: Main Database
1111
-->
@@ -419,6 +419,9 @@ <h4>
419419
<li>
420420
<code class="key">Delphi11A</code> – Delphi 11.x Alexandria compiler *
421421
</li>
422+
<li>
423+
<code class="key">Delphi12A</code> – Delphi 12 Athens compiler *
424+
</li>
422425
<li>
423426
<code class="key">FPC</code> – Free Pascal compiler
424427
</li>

Diff for: Docs/Design/FileFormats/user-db.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
66
* obtain one at https://mozilla.org/MPL/2.0/
77
*
8-
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
8+
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
99
*
1010
* CodeSnip File Format Documentation: User Database
1111
-->
@@ -631,6 +631,9 @@ <h3 id="xml-file">
631631
<li>
632632
<em>d11a</em> &ndash; Delphi 11.x Alexandria compiler <span class="highlight">(v6.10 &amp; later)</span>
633633
</li>
634+
<li>
635+
<em>d12y</em> &ndash; Delphi 12 Athens compiler <span class="highlight">(v6.12 &amp; later)</span>
636+
</li>
634637
<li>
635638
<em>fpc</em> &ndash; Free Pascal compiler <span class="highlight">(all versions)</span>
636639
</li>
@@ -1020,6 +1023,12 @@ <h2>
10201023
<dd>
10211024
Updated with CodeSnip v4.21.0 to add support for REML v5, which is backwards compatible with REML v4.
10221025
</dd>
1026+
<dt>
1027+
<em>Version 6.12 - 7 November 2023</em>
1028+
</dt>
1029+
<dd>
1030+
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
1031+
</dd>
10231032
</dl>
10241033
</dd>
10251034
</dl>

Diff for: Docs/ReadMe.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ online DelphiDabbler Code Snippets database as well as maintain a database of
1414
user-defined snippets.
1515

1616
It displays details of each snippet in the database and can test-compile them
17-
with each installed Win32 version of Delphi from Delphi 2 to Delphi 11.x
18-
Alexandria and Free Pascal.
17+
with each installed Win32 version of Delphi from Delphi 2 to Delphi 12 Athens
18+
and Free Pascal.
1919

2020
Compilable Pascal units can be created that contain selected snippets.
2121

@@ -204,8 +204,8 @@ Configuring CodeSnip to Work With Your Compilers
204204
================================================================================
205205

206206
A feature of CodeSnip is its ability to test compile snippets with any installed
207-
Windows 32 version of Delphi (from Delphi 2 to Delphi 11.x Alexandria) and
208-
FreePascal, providing some simple rules are followed.
207+
Windows 32 version of Delphi (from Delphi 2 to Delphi 12 Athens) and FreePascal,
208+
providing some simple rules are followed.
209209

210210
When CodeSnip is first installed it knows nothing about the available compilers
211211
and so test compilations cannot be performed. If any supported Delphi compiler

Diff for: Src/Compilers.UBDS.pas

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2006-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Class that controls and provides information about Borland CodeGear and
99
* Embarcadero "BDS" Win32 compilers.
@@ -152,6 +152,8 @@ function TBDSCompiler.GetIDString: string;
152152
Result := 'D104S';
153153
ciD11A:
154154
Result := 'D11A';
155+
ciD12A:
156+
Result := 'D12Y';
155157
else
156158
raise EBug.Create(ClassName + '.GetIDString: Invalid ID');
157159
end;
@@ -175,7 +177,8 @@ function TBDSCompiler.GetName: string;
175177
sDelphi102T = 'Delphi 10.2 Tokyo';
176178
sDelphi103R = 'Delphi 10.3 Rio';
177179
sDelphi104S = 'Delphi 10.4 Sydney';
178-
sDelphi11A = 'Delphi 11.x Alexandria';
180+
sDelphi11A = 'Delphi 11.x Alexandria';
181+
sDelphi12A = 'Delphi 12 Athens';
179182
begin
180183
case GetID of
181184
ciDXE:
@@ -206,6 +209,8 @@ function TBDSCompiler.GetName: string;
206209
Result := sDelphi104S;
207210
ciD11A:
208211
Result := sDelphi11A;
212+
ciD12A:
213+
Result := sDelphi12A;
209214
else
210215
Result := Format(sCompilerName, [ProductVersion]);
211216
end;
@@ -240,6 +245,7 @@ function TBDSCompiler.InstallationRegKey: string;
240245
ciD103R : Result := '\Software\Embarcadero\BDS\20.0';
241246
ciD104S : Result := '\Software\Embarcadero\BDS\21.0';
242247
ciD11A : Result := '\Software\Embarcadero\BDS\22.0';
248+
ciD12A : Result := '\Software\Embarcadero\BDS\23.0';
243249
else raise EBug.Create(ClassName + '.InstallationRegKey: Invalid ID');
244250
end;
245251
end;

Diff for: Src/Compilers.UGlobals.pas

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Declares various types that describe the compiler and compilation results and
99
* defines interfaces to compiler objects.
@@ -44,6 +44,7 @@ interface
4444
ciD103R, // Delphi 10.3 Rio
4545
ciD104S, // Delphi 10.4 Sydney,
4646
ciD11A, // Delphi 11.x Alexandria
47+
ciD12A, // Delphi 12 Athens
4748
ciFPC // Free Pascal
4849
);
4950

@@ -57,7 +58,7 @@ interface
5758
cBDSCompilers = [
5859
ciD2005w32, ciD2006w32, ciD2007, ciD2009w32, ciD2010, ciDXE, ciDXE2,
5960
ciDXE3, ciDXE4, ciDXE5, ciDXE6, ciDXE7, ciDXE8, ciD10S, ciD101B, ciD102T,
60-
ciD103R, ciD104S, ciD11A
61+
ciD103R, ciD104S, ciD11A, ciD12A
6162
];
6263

6364
const

Diff for: Src/Compilers.USettings.pas

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ TCompilerSettings = class(TNoConstructObject)
2727
const
2828
AllCompilersConfigSection = ssCompilers;
2929
PermitStartupDetectionKey = 'PermitStartupDetection';
30-
ListFPCAtTopKey = 'Lists:FPCAtTop';
31-
ListDelphiOldestFirstKey = 'Lists:DelphiOldestFirst';
3230
class function ReadStorage: ISettingsSection;
3331
class procedure DoSaveProperty(const WriteProp: TProc<ISettingsSection>);
3432
class procedure SaveProperty(const Key: string; const Value: Boolean);

Diff for: Src/DB.UMain.pas

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Defines a singleton object and subsidiary classes that encapsulate the
99
* snippets and categories in the CodeSnip database and user defined databases.
@@ -954,11 +954,9 @@ procedure TDatabase.Load;
954954
try
955955
// Load main database: MUST do this first since user database can
956956
// reference objects in main database
957-
with TDatabaseIOFactory.CreateMainDBLoader do
958-
Load(fSnippets, fCategories, Factory);
957+
TDatabaseIOFactory.CreateMainDBLoader.Load(fSnippets, fCategories, Factory);
959958
// Load any user database
960-
with TDatabaseIOFactory.CreateUserDBLoader do
961-
Load(fSnippets, fCategories, Factory);
959+
TDatabaseIOFactory.CreateUserDBLoader.Load(fSnippets, fCategories, Factory);
962960
fUpdated := False;
963961
except
964962
// If an exception occurs clear the database
@@ -984,8 +982,7 @@ procedure TDatabase.Save;
984982
// Create object that can provide required information about user database
985983
Provider := TUserDataProvider.Create(fSnippets, fCategories);
986984
// Use a writer object to write out the database
987-
with TDatabaseIOFactory.CreateWriter do
988-
Write(fSnippets, fCategories, Provider);
985+
TDatabaseIOFactory.CreateWriter.Write(fSnippets, fCategories, Provider);
989986
fUpdated := False;
990987
end;
991988

Diff for: Src/DBIO.UIniDataReader.pas

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements code that reads the main CodeSnip database from .ini and .dat
99
* files.
@@ -236,6 +236,7 @@ implementation
236236
'Delphi2010', 'DelphiXE', 'DelphiXE2', 'DelphiXE3', 'DelphiXE4',
237237
'DelphiXE5', 'DelphiXE6', 'DelphiXE7', 'DelphiXE8', 'Delphi10S',
238238
'Delphi101B', 'Delphi102T', 'Delphi103R', 'Delphi104S', 'Delphi11A',
239+
'Delphi12A',
239240
'FPC'
240241
);
241242

Diff for: Src/FirstRun.FmV4ConfigDlg.pas

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements a wizard dialogue box that may be displayed on the first run of
99
* CodeSnip v4 to get user to decide whether what data to bring forward from
@@ -289,14 +289,16 @@ function TV4ConfigDlg.DatabaseAvailable: Boolean;
289289

290290
class procedure TV4ConfigDlg.Execute(AOwner: TComponent;
291291
const FirstRun: TFirstRun);
292+
var
293+
Dlg: TV4ConfigDlg;
292294
begin
293-
with InternalCreate(AOwner) do
294-
try
295-
fFirstRun := FirstRun;
296-
ShowModal;
297-
finally
298-
Free;
299-
end;
295+
Dlg := InternalCreate(AOwner);
296+
try
297+
Dlg.fFirstRun := FirstRun;
298+
Dlg.ShowModal;
299+
finally
300+
Dlg.Free;
301+
end;
300302
end;
301303

302304
procedure TV4ConfigDlg.FormCloseQuery(Sender: TObject; var CanClose: Boolean);

Diff for: Src/FirstRun.FmWhatsNew.pas

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2020-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2020-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements dialogue box that may be displayed the first time CodeSnip 4.x.x
99
* is run after an update. The dialogue box displays a HTML page that draws
@@ -114,13 +114,15 @@ procedure TWhatsNewDlg.CreateParams(var Params: TCreateParams);
114114
end;
115115

116116
class procedure TWhatsNewDlg.Execute(AOwner: TComponent);
117+
var
118+
Dlg: TWhatsNewDlg;
117119
begin
118-
with InternalCreate(AOwner) do
119-
try
120-
ShowModal;
121-
finally
122-
Free;
123-
end;
120+
Dlg := InternalCreate(AOwner);
121+
try
122+
Dlg.ShowModal;
123+
finally
124+
Dlg.Free;
125+
end;
124126
end;
125127

126128
function TWhatsNewDlg.GetAligner: IFormAligner;

Diff for: Src/FmAboutDlg.pas

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements the program's About dialogue box.
99
}
@@ -326,13 +326,15 @@ function TAboutDlg.ContribListHTML(ContribList: IStringList):
326326
end;
327327

328328
class procedure TAboutDlg.Execute(AOwner: TComponent);
329+
var
330+
Dlg: TAboutDlg;
329331
begin
330-
with Create(AOwner) do
331-
try
332-
ShowModal;
333-
finally
334-
Free;
335-
end;
332+
Dlg := Create(AOwner);
333+
try
334+
Dlg.ShowModal;
335+
finally
336+
Dlg.Free;
337+
end;
336338
end;
337339

338340
procedure TAboutDlg.FormCreate(Sender: TObject);

0 commit comments

Comments
 (0)