Skip to content

Commit

Permalink
Merge branch 'release/4.22.0'
Browse files Browse the repository at this point in the history
Release v4.22.0
  • Loading branch information
delphidabbler committed Nov 8, 2023
2 parents dd17a64 + 16f0951 commit 90cc0bb
Show file tree
Hide file tree
Showing 76 changed files with 1,075 additions and 910 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ Releases are listed in reverse version number order.

> 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.
## Release v4.21.2 of 13 July 2023
## Release v4.22.0 of 08 November 2023

* Added support for test compiling snippets with Delphi 12 Athens [issue #121].
* Documentation changes re addition of support for Delphi 12:
* File format additions for config, export, user database and main database.
* `Docs/ReadMe.txt`.
* Relevant help topics.
* 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].
* Refactored out all `with` statements from Pascal source code [issue #118].
* Fixed error in `CHANGELOG.md` entry for release v4.21.2 [issue #120].

## Release v4.21.2 of 14 July 2023

* Removed broken links and fixed unsafe links in the About box [issue #105].
* 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].
* 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].
* Fixed potential XSS vulnerability in JQuery code used in Easter egg [issue #107].
* Documentation changes:
* Rationalised, corrected, updated and clarified licensing information. These changes affected many documentation files. [issue #108].
Expand Down
11 changes: 10 additions & 1 deletion Docs/Design/FileFormats/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: Configuration Files
-->
Expand Down Expand Up @@ -259,6 +259,9 @@ <h4>
<li>
<em>D11A</em> &ndash; Delphi 11.x Alexandria
</li>
<li>
<em>D12Y</em> &ndash; Delphi 12 Athens
</li>
<li>
<em>FPC</em> &ndash; Free Pascal
</li>
Expand Down Expand Up @@ -613,6 +616,12 @@ <h4>
<dd>
Indicates whether Delphi 11.x Alexandria was included in the search.
</dd>
<dt>
<code class="key">D12Y</code> (Boolean)
</dt>
<dd>
Indicates whether Delphi 12 Athens was included in the search.
</dd>
<dt>
<code class="key">FPC</code> (Boolean)
</dt>
Expand Down
11 changes: 10 additions & 1 deletion Docs/Design/FileFormats/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: Export
-->
Expand Down Expand Up @@ -606,6 +606,9 @@ <h2>
<li>
<em>d11a</em> &ndash; Delphi 11.x Alexandria compiler <span class="highlight">(v7.2 &amp; later)</span>
</li>
<li>
<em>d12y</em> &ndash; Delphi 12 Athens compiler <span class="highlight">(v7.4 &amp; later)</span>
</li>
<li>
<em>fpc</em> &ndash; Free Pascal compiler <span class="highlight">(all versions)</span>
</li>
Expand Down Expand Up @@ -984,6 +987,12 @@ <h2>
<dd>
Updated with CodeSnip v4.21.0 to add support for REML v5, which is backward compatible with REML v4.
</dd>
<dt>
<em>Version 7.4 - 7 November 2023</em>
</dt>
<dd>
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
</dd>
</dl>
</dd>
</dl>
Expand Down
5 changes: 4 additions & 1 deletion Docs/Design/FileFormats/main-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: Main Database
-->
Expand Down Expand Up @@ -419,6 +419,9 @@ <h4>
<li>
<code class="key">Delphi11A</code> – Delphi 11.x Alexandria compiler *
</li>
<li>
<code class="key">Delphi12A</code> – Delphi 12 Athens compiler *
</li>
<li>
<code class="key">FPC</code> – Free Pascal compiler
</li>
Expand Down
11 changes: 10 additions & 1 deletion Docs/Design/FileFormats/user-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* CodeSnip File Format Documentation: User Database
-->
Expand Down Expand Up @@ -631,6 +631,9 @@ <h3 id="xml-file">
<li>
<em>d11a</em> &ndash; Delphi 11.x Alexandria compiler <span class="highlight">(v6.10 &amp; later)</span>
</li>
<li>
<em>d12y</em> &ndash; Delphi 12 Athens compiler <span class="highlight">(v6.12 &amp; later)</span>
</li>
<li>
<em>fpc</em> &ndash; Free Pascal compiler <span class="highlight">(all versions)</span>
</li>
Expand Down Expand Up @@ -1020,6 +1023,12 @@ <h2>
<dd>
Updated with CodeSnip v4.21.0 to add support for REML v5, which is backwards compatible with REML v4.
</dd>
<dt>
<em>Version 6.12 - 7 November 2023</em>
</dt>
<dd>
Updated in time for CodeSnip v4.22.0 to add support for Delphi 12 Athens.
</dd>
</dl>
</dd>
</dl>
Expand Down
8 changes: 4 additions & 4 deletions Docs/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ online DelphiDabbler Code Snippets database as well as maintain a database of
user-defined snippets.

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

Compilable Pascal units can be created that contain selected snippets.

Expand Down Expand Up @@ -204,8 +204,8 @@ Configuring CodeSnip to Work With Your Compilers
================================================================================

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

When CodeSnip is first installed it knows nothing about the available compilers
and so test compilations cannot be performed. If any supported Delphi compiler
Expand Down
10 changes: 8 additions & 2 deletions Src/Compilers.UBDS.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2006-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2006-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Class that controls and provides information about Borland CodeGear and
* Embarcadero "BDS" Win32 compilers.
Expand Down Expand Up @@ -152,6 +152,8 @@ function TBDSCompiler.GetIDString: string;
Result := 'D104S';
ciD11A:
Result := 'D11A';
ciD12A:
Result := 'D12Y';
else
raise EBug.Create(ClassName + '.GetIDString: Invalid ID');
end;
Expand All @@ -175,7 +177,8 @@ function TBDSCompiler.GetName: string;
sDelphi102T = 'Delphi 10.2 Tokyo';
sDelphi103R = 'Delphi 10.3 Rio';
sDelphi104S = 'Delphi 10.4 Sydney';
sDelphi11A = 'Delphi 11.x Alexandria';
sDelphi11A = 'Delphi 11.x Alexandria';
sDelphi12A = 'Delphi 12 Athens';
begin
case GetID of
ciDXE:
Expand Down Expand Up @@ -206,6 +209,8 @@ function TBDSCompiler.GetName: string;
Result := sDelphi104S;
ciD11A:
Result := sDelphi11A;
ciD12A:
Result := sDelphi12A;
else
Result := Format(sCompilerName, [ProductVersion]);
end;
Expand Down Expand Up @@ -240,6 +245,7 @@ function TBDSCompiler.InstallationRegKey: string;
ciD103R : Result := '\Software\Embarcadero\BDS\20.0';
ciD104S : Result := '\Software\Embarcadero\BDS\21.0';
ciD11A : Result := '\Software\Embarcadero\BDS\22.0';
ciD12A : Result := '\Software\Embarcadero\BDS\23.0';
else raise EBug.Create(ClassName + '.InstallationRegKey: Invalid ID');
end;
end;
Expand Down
5 changes: 3 additions & 2 deletions Src/Compilers.UGlobals.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Declares various types that describe the compiler and compilation results and
* defines interfaces to compiler objects.
Expand Down Expand Up @@ -44,6 +44,7 @@ interface
ciD103R, // Delphi 10.3 Rio
ciD104S, // Delphi 10.4 Sydney,
ciD11A, // Delphi 11.x Alexandria
ciD12A, // Delphi 12 Athens
ciFPC // Free Pascal
);

Expand All @@ -57,7 +58,7 @@ interface
cBDSCompilers = [
ciD2005w32, ciD2006w32, ciD2007, ciD2009w32, ciD2010, ciDXE, ciDXE2,
ciDXE3, ciDXE4, ciDXE5, ciDXE6, ciDXE7, ciDXE8, ciD10S, ciD101B, ciD102T,
ciD103R, ciD104S, ciD11A
ciD103R, ciD104S, ciD11A, ciD12A
];

const
Expand Down
2 changes: 0 additions & 2 deletions Src/Compilers.USettings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ TCompilerSettings = class(TNoConstructObject)
const
AllCompilersConfigSection = ssCompilers;
PermitStartupDetectionKey = 'PermitStartupDetection';
ListFPCAtTopKey = 'Lists:FPCAtTop';
ListDelphiOldestFirstKey = 'Lists:DelphiOldestFirst';
class function ReadStorage: ISettingsSection;
class procedure DoSaveProperty(const WriteProp: TProc<ISettingsSection>);
class procedure SaveProperty(const Key: string; const Value: Boolean);
Expand Down
11 changes: 4 additions & 7 deletions Src/DB.UMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Defines a singleton object and subsidiary classes that encapsulate the
* snippets and categories in the CodeSnip database and user defined databases.
Expand Down Expand Up @@ -954,11 +954,9 @@ procedure TDatabase.Load;
try
// Load main database: MUST do this first since user database can
// reference objects in main database
with TDatabaseIOFactory.CreateMainDBLoader do
Load(fSnippets, fCategories, Factory);
TDatabaseIOFactory.CreateMainDBLoader.Load(fSnippets, fCategories, Factory);
// Load any user database
with TDatabaseIOFactory.CreateUserDBLoader do
Load(fSnippets, fCategories, Factory);
TDatabaseIOFactory.CreateUserDBLoader.Load(fSnippets, fCategories, Factory);
fUpdated := False;
except
// If an exception occurs clear the database
Expand All @@ -984,8 +982,7 @@ procedure TDatabase.Save;
// Create object that can provide required information about user database
Provider := TUserDataProvider.Create(fSnippets, fCategories);
// Use a writer object to write out the database
with TDatabaseIOFactory.CreateWriter do
Write(fSnippets, fCategories, Provider);
TDatabaseIOFactory.CreateWriter.Write(fSnippets, fCategories, Provider);
fUpdated := False;
end;

Expand Down
3 changes: 2 additions & 1 deletion Src/DBIO.UIniDataReader.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Implements code that reads the main CodeSnip database from .ini and .dat
* files.
Expand Down Expand Up @@ -236,6 +236,7 @@ implementation
'Delphi2010', 'DelphiXE', 'DelphiXE2', 'DelphiXE3', 'DelphiXE4',
'DelphiXE5', 'DelphiXE6', 'DelphiXE7', 'DelphiXE8', 'Delphi10S',
'Delphi101B', 'Delphi102T', 'Delphi103R', 'Delphi104S', 'Delphi11A',
'Delphi12A',
'FPC'
);

Expand Down
18 changes: 10 additions & 8 deletions Src/FirstRun.FmV4ConfigDlg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2012-2021, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2012-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Implements a wizard dialogue box that may be displayed on the first run of
* CodeSnip v4 to get user to decide whether what data to bring forward from
Expand Down Expand Up @@ -289,14 +289,16 @@ function TV4ConfigDlg.DatabaseAvailable: Boolean;

class procedure TV4ConfigDlg.Execute(AOwner: TComponent;
const FirstRun: TFirstRun);
var
Dlg: TV4ConfigDlg;
begin
with InternalCreate(AOwner) do
try
fFirstRun := FirstRun;
ShowModal;
finally
Free;
end;
Dlg := InternalCreate(AOwner);
try
Dlg.fFirstRun := FirstRun;
Dlg.ShowModal;
finally
Dlg.Free;
end;
end;

procedure TV4ConfigDlg.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
Expand Down
16 changes: 9 additions & 7 deletions Src/FirstRun.FmWhatsNew.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2020-2021, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2020-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Implements dialogue box that may be displayed the first time CodeSnip 4.x.x
* is run after an update. The dialogue box displays a HTML page that draws
Expand Down Expand Up @@ -114,13 +114,15 @@ procedure TWhatsNewDlg.CreateParams(var Params: TCreateParams);
end;

class procedure TWhatsNewDlg.Execute(AOwner: TComponent);
var
Dlg: TWhatsNewDlg;
begin
with InternalCreate(AOwner) do
try
ShowModal;
finally
Free;
end;
Dlg := InternalCreate(AOwner);
try
Dlg.ShowModal;
finally
Dlg.Free;
end;
end;

function TWhatsNewDlg.GetAligner: IFormAligner;
Expand Down
16 changes: 9 additions & 7 deletions Src/FmAboutDlg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at https://mozilla.org/MPL/2.0/
*
* Copyright (C) 2005-2022, Peter Johnson (gravatar.com/delphidabbler).
* Copyright (C) 2005-2023, Peter Johnson (gravatar.com/delphidabbler).
*
* Implements the program's About dialogue box.
}
Expand Down Expand Up @@ -326,13 +326,15 @@ function TAboutDlg.ContribListHTML(ContribList: IStringList):
end;

class procedure TAboutDlg.Execute(AOwner: TComponent);
var
Dlg: TAboutDlg;
begin
with Create(AOwner) do
try
ShowModal;
finally
Free;
end;
Dlg := Create(AOwner);
try
Dlg.ShowModal;
finally
Dlg.Free;
end;
end;

procedure TAboutDlg.FormCreate(Sender: TObject);
Expand Down
Loading

0 comments on commit 90cc0bb

Please sign in to comment.