Skip to content

Commit e5c9d39

Browse files
committed
Merge branch 'develop' into feature/issue#13-prefs-dlg
2 parents 43db9f0 + 781a2d5 commit e5c9d39

File tree

7 files changed

+136
-83
lines changed

7 files changed

+136
-83
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ This change log begins with the first ever pre-release version of _CodeSnip_. Re
1212
From v4.1.0 the version numbering has attempted to adhere to the principles of [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1313

1414

15+
## Release v4.18.1 of 29 November 2021
16+
17+
* Improved handling of control and whitespace characters in generated HTML: revised which characters were converted to HTML character attributes / entities.
18+
* Fixed error in title of _Save Annotated Source_ dialogue box.
19+
* Replaced use 3rd party `GIFImage` unit with similar `GIFImg` unit from Delphi XE VCL.
20+
* Corrected help topic for _Dependencies_ dialogue box to describe _Save & Close_ button.
21+
* Operating system detection code was updated to correctly detect Windows 11 and Windows 10 version 21H2.
22+
* Some refactoring.
23+
* Updated license document (`License.html`) following removal of dependency on GIFImage unit.
24+
25+
1526
## Release v4.18.0 of 13 September 2021
1627

1728
* Added support for test compilation with, and detection of, Delphi 11 Alexandria.

Src/3rdParty/PJSysInfo.pas

Lines changed: 84 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2001-2020, Peter Johnson (@delphidabbler).
6+
* Copyright (C) 2001-2021, Peter Johnson (@delphidabbler).
77
*
8-
* $Rev: 2069 $
9-
* $Date: 2021-09-14 16:00:48 +0100 (Tue, 14 Sep 2021) $
8+
* $Rev: 2079 $
9+
* $Date: 2021-11-27 14:29:47 +0000 (Sat, 27 Nov 2021) $
1010
*
1111
* This unit contains various static classes, constants, type definitions and
1212
* global variables for use in providing information about the host computer and
@@ -1185,9 +1185,12 @@ implementation
11851185
https://en.wikipedia.org/wiki/Windows_Server
11861186
https://en.wikipedia.org/wiki/Windows_Server_2019
11871187
https://en.wikipedia.org/wiki/Windows_Server_2016
1188-
https://tinyurl.com/y8tfadm2
1189-
https://tinyurl.com/usupsz4a
1188+
https://tinyurl.com/y8tfadm2 (MS Windows Server release information)
1189+
https://tinyurl.com/usupsz4a (Win 11 Version Numbers & Build Versions)
11901190
https://docs.microsoft.com/en-us/lifecycle/products/windows-server-2022
1191+
https://tinyurl.com/yj5e72jt (MS Win 10 release info)
1192+
https://tinyurl.com/kd3weeu7 (MS Server release info)
1193+
11911194
11921195
Note:
11931196
For Vista and Win 7 we have to add service pack number to these values to
@@ -1218,30 +1221,32 @@ implementation
12181221
Win1020H1Build = 19041; // Windows 10 20H1 - version 2004
12191222
Win1020H2Build = 19042; // Windows 10 20H2 - version 20H2
12201223
Win1021H1Build = 19043; // Windows 10 21H1 - version 21H1
1221-
{ TODO: 2021-09-11
1222-
- Win 21H2 due late 2021
1223-
- Update following var name once Win21H2 released}
1224-
_Win1021H2Build = 19044; // Windows 10 21H2 - version 21H2
1224+
Win1021H2Build = 19044; // Windows 10 21H2 - version 21H2
12251225

12261226
// Windows 11 ----------------------------------------------------------------
1227-
{ TODO: 2021-09-11
1228-
- Add more Win11 versions as discovered. }
1229-
// NOTE: Preview and beta versions of Windows 11 report version 10.0
1227+
// NOTE: Preview and beta & release versions of Windows 11 report version 10.0
12301228
Win11DevBuild = 21996; // Windows 11 version Dev
12311229
// - 10.0.21996.1 (Insider version)
12321230
Win11v21H2Build = 22000; // Version depends on revision # [Rev#]:
1233-
// Revision # 51..168:
1231+
// Revision # 51,65,71,100,120,132,168:
12341232
// Windows 11 version 21H2
12351233
// - 10.0.22000.[Rev#] (Insider version)
12361234
// Revision # 184
12371235
// Windows 11 version 21H2
12381236
// - 10.0.22000.184 (Beta Version)
1239-
// Revision # >=185
1240-
// Windows 11 (unknown version)
1241-
Win11c21H2PreRel1Build = 22449; // Windows 11 version 21H2
1237+
// Revision # 194
1238+
// Windows 11 version 21H2
1239+
// - ** 1st Public Release **
1240+
Win11v21H2PreRel1Build = 22449; // Windows 11 version 21H2
12421241
// - 10.0.22449.000 (RSPRERELEASE)
1243-
Win11c21H2PreRel2Build = 22454; // Windows 11 version 21H2
1242+
Win11v21H2PreRel2Build = 22454; // Windows 11 version 21H2
12441243
// - 10.0.22454.1000 (RSPRERELEASE)
1244+
Win11v21H2PreRel3Build = 22458; // Windows 11 version 21H2
1245+
// - 10.0.22458.1000 (RSPRERELEASE)
1246+
Win11v21H2PreRel4Build = 22463; // Windows 11 version 21H2
1247+
// - 10.0.22463.1000 (RSPRERELEASE)
1248+
Win11v21H2PreRel5Build = 22468; // Windows 11 version 21H2
1249+
// - 10.0.22468.1000 (RSPRERELEASE)
12451250

12461251
Win11FirstBuild = Win11DevBuild; // First build number of Windows 11
12471252

@@ -1724,13 +1729,16 @@ procedure InitPlatformIdEx;
17241729
begin
17251730
case InternalMinorVersion of
17261731
0:
1732+
// ** As of 2021/10/05 all releases of Windows 10 **and**
1733+
// Windows 11 report major version 10 and minor version 0
17271734
if (Win32ProductType <> VER_NT_DOMAIN_CONTROLLER)
17281735
and (Win32ProductType <> VER_NT_SERVER) then
17291736
begin
17301737
if IsBuildNumber(Win10TH1Build) then
17311738
begin
1739+
// First public release of Window 10
17321740
InternalBuildNumber := Win10TH1Build;
1733-
InternalExtraUpdateInfo := 'Version 1507'; // 1st Win 10 version
1741+
InternalExtraUpdateInfo := 'Version 1507';
17341742
end
17351743
else if IsBuildNumber(Win10TH2Build) then
17361744
begin
@@ -1789,25 +1797,16 @@ procedure InitPlatformIdEx;
17891797
InternalBuildNumber := Win1021H1Build;
17901798
InternalExtraUpdateInfo := 'Version 21H1';
17911799
end
1792-
else if IsBuildNumber(_Win1021H2Build) then
1800+
else if IsBuildNumber(Win1021H2Build) then
17931801
begin
1794-
{ TODO: Added 2021/09/11
1795-
- Release expected late 2021
1796-
- Fix build number if necessary
1797-
- Remove underscore prefix from const name
1798-
- Fix value of InternalExtraUpdateInfo as required }
1799-
InternalBuildNumber := _Win1021H2Build;
1802+
// From 21H2 Windows 10 moves from a 6 monthly update cycle to a
1803+
// yearly cycle
1804+
InternalBuildNumber := Win1021H2Build;
18001805
InternalExtraUpdateInfo := 'Version 21H2';
18011806
end
18021807
// As of 2021-09-11, Win 11 pre-releases are reporting v10.0
18031808
// Details taken from: https://tinyurl.com/usupsz4a
1804-
// Correct according to above web oage as of 2021-09-11
1805-
{ TODO: Added 2021-09-11
1806-
- Revisit URL to check for change following official release
1807-
of Windows 11
1808-
- Add any further pre-release versions
1809-
- Check if final release has major version 11
1810-
}
1809+
// Correct according to above web page as of 2021-09-11
18111810
else if IsBuildNumber(Win11DevBuild) then
18121811
begin
18131812
InternalBuildNumber := Win11DevBuild;
@@ -1821,49 +1820,74 @@ procedure InitPlatformIdEx;
18211820
// There are several Win 11 releases with this build number
18221821
// Which release we're talking about depends on the revision
18231822
// number.
1823+
// *** Amazingly one of them, revision 194, is the 1st public
1824+
// release of Win 11 -- well hidden eh?!
18241825
InternalBuildNumber := Win11v21H2Build;
1825-
if InternalRevisionNumber in [51, 65, 71, 100, 120, 132, 168] then
1826-
begin
1827-
InternalExtraUpdateInfo := Format(
1828-
'Version 21H2 [Insider v10.0.%d.%d]',
1829-
[InternalBuildNumber, InternalRevisionNumber]
1830-
);
1831-
end
1832-
else if InternalRevisionNumber = 184 then
1833-
begin
1834-
InternalExtraUpdateInfo := Format(
1835-
'Version 21H2 [Beta v10.0.%d.%d]',
1836-
[InternalBuildNumber, InternalRevisionNumber]
1837-
);
1838-
end
1839-
else
1840-
begin
1841-
InternalExtraUpdateInfo := Format(
1842-
'Unknown release v10.0.%d.%d',
1843-
[InternalBuildNumber, InternalRevisionNumber]
1844-
);
1826+
case InternalBuildNumber of
1827+
194:
1828+
// First public release of Windows 11
1829+
InternalExtraUpdateInfo := 'Version 21H2';
1830+
51, 65, 71, 100, 120, 132, 168:
1831+
InternalExtraUpdateInfo := Format(
1832+
'Version 21H2 [Insider v10.0.%d.%d]',
1833+
[InternalBuildNumber, InternalRevisionNumber]
1834+
);
1835+
184:
1836+
InternalExtraUpdateInfo := Format(
1837+
'Version 21H2 [Beta v10.0.%d.%d]',
1838+
[InternalBuildNumber, InternalRevisionNumber]
1839+
);
1840+
else
1841+
InternalExtraUpdateInfo := Format(
1842+
'Unknown release v10.0.%d.%d',
1843+
[InternalBuildNumber, InternalRevisionNumber]
1844+
);
18451845
end;
18461846
end
1847-
else if IsBuildNumber(Win11c21H2PreRel1Build) then
1847+
else if IsBuildNumber(Win11v21H2PreRel1Build) then
18481848
begin
1849-
InternalBuildNumber := Win11c21H2PreRel1Build;
1849+
InternalBuildNumber := Win11v21H2PreRel1Build;
18501850
InternalExtraUpdateInfo := Format(
18511851
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
18521852
[InternalBuildNumber, InternalRevisionNumber]
18531853
);
18541854
end
1855-
else if IsBuildNumber(Win11c21H2PreRel2Build) then
1855+
else if IsBuildNumber(Win11v21H2PreRel2Build) then
18561856
begin
1857-
InternalBuildNumber := Win11c21H2PreRel2Build;
1857+
InternalBuildNumber := Win11v21H2PreRel2Build;
18581858
InternalExtraUpdateInfo := Format(
18591859
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
18601860
[InternalBuildNumber, InternalRevisionNumber]
18611861
);
1862-
end;
1862+
end
1863+
else if IsBuildNumber(Win11v21H2PreRel3Build) then
1864+
begin
1865+
InternalBuildNumber := Win11v21H2PreRel3Build;
1866+
InternalExtraUpdateInfo := Format(
1867+
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1868+
[InternalBuildNumber, InternalRevisionNumber]
1869+
);
1870+
end
1871+
else if IsBuildNumber(Win11v21H2PreRel4Build) then
1872+
begin
1873+
InternalBuildNumber := Win11v21H2PreRel4Build;
1874+
InternalExtraUpdateInfo := Format(
1875+
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1876+
[InternalBuildNumber, InternalRevisionNumber]
1877+
);
1878+
end
1879+
else if IsBuildNumber(Win11v21H2PreRel5Build) then
1880+
begin
1881+
InternalBuildNumber := Win11v21H2PreRel5Build;
1882+
InternalExtraUpdateInfo := Format(
1883+
'Version 21H2 [RSPRERELEASE v10.0.%d.%d]',
1884+
[InternalBuildNumber, InternalRevisionNumber]
1885+
);
1886+
end
18631887
end
1864-
else
1888+
else // Win32ProductType in [VER_NT_DOMAIN_CONTROLLER, VER_NT_SERVER]
18651889
begin
1866-
// Check for Win Server 2016 echnical previews.
1890+
// Check for Win Server 2016 technical previews.
18671891
// We don't check for TP1 // here because that reported version 6.4,
18681892
// not version 10!
18691893
if IsBuildNumber(Win2016TP2Build) then
@@ -2685,7 +2709,7 @@ class function TPJOSInfo.Product: TPJOSProduct;
26852709
if InternalBuildNumber < Win11FirstBuild then
26862710
Result := osWin10
26872711
else
2688-
// As of 2021-09-11 Win 11 is reporting version 10.0
2712+
// ** As of 2021-10-05 Win 11 is reporting version 10.0!
26892713
Result := osWin11;
26902714
end
26912715
else

Src/Help/HTML/dlg_dependencies.htm

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ <h1>
2929
<p>
3030
This dialogue box is displayed by choosing the <em>View |
3131
Dependencies</em> menu item or by pressing
32-
<span class="smallcaps">Ctrl+D</span>. It has two tabs:
33-
<em>Depends Upon</em> and <em>Required By</em>.
32+
<span class="smallcaps">Ctrl+D</span>.
3433
</p>
3534
<h2>
36-
<em>Depends Upon</em> Tab
35+
Tabs
3736
</h2>
37+
<p>
38+
The dialogue box has two tabs: <em>Depends Upon</em> and <em>Required
39+
By</em>.
40+
</p>
41+
<h3>
42+
<em>Depends Upon</em> Tab
43+
</h3>
3844
<p>
3945
If the selected snippet has dependencies (i.e. snippets it depends upon in
4046
order to compile) a tree of snippets is displayed that shows the direct
@@ -47,13 +53,27 @@ <h2>
4753
error message is displayed. Such a dependency indicates there is an error
4854
in the database.
4955
</p>
50-
<h2>
56+
<h3>
5157
<em>Required By</em> Tab
52-
</h2>
58+
</h3>
5359
<p>
5460
This tab displays a simple list of snippets that immediately depend on the
5561
selected snippet. Again, if there are no snippets to list, a message is
5662
displayed to that effect.
5763
</p>
64+
<h2>
65+
<em>Select &amp; Close</em> button
66+
</h2>
67+
<p>
68+
This button appears to the left of the <em>Close</em> and <em>Help</em>
69+
buttons. It's purpose is to select the snippets listed on the currently
70+
active tab and to display that selection when the dialogue box is closed.
71+
If the active tab lists no snippets then the button is disabled.
72+
</p>
73+
<p>
74+
<strong class="warning">Warning:</strong> Any selection made using this
75+
button will replace any search results that were previously displayed. No
76+
warning will be displayed.
77+
</p>
5878
</body>
5979
</html>

Src/UConsts.pas

Lines changed: 5 additions & 1 deletion
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 http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2009-2020, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2009-2021, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Defines various character, string and resource id constants.
99
}
@@ -29,8 +29,12 @@ interface
2929
CR = #13; // carriage return character
3030
SUB = #26; // ASCII SUB character
3131
ESC = #27; // escape character
32+
3233
SINGLEQUOTE = ''''; // single quote character
3334
DOUBLEQUOTE = '"'; // double quote character
35+
AMPERSAND = '&'; // ampersand character
36+
GT = '>'; // greater-than / closing angle bracket character
37+
LT = '<'; // less-than / opening angle bracket character
3438

3539
CRLF = CR + LF; // carriage return followed by line feed
3640
EOL = CRLF; // end of line character sequence for Windows systems

Src/UHTMLUtils.pas

Lines changed: 7 additions & 13 deletions
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 http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2005-2020, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2005-2021, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Helper interfaces and classes used to generate HTML.
99
}
@@ -227,18 +227,12 @@ class function THTML.Entities(const Text: string): string;
227227
for Ch in Text do
228228
begin
229229
case Ch of
230-
'<':
231-
SB.Append('&lt;');
232-
'>':
233-
SB.Append('&gt;');
234-
'&':
235-
SB.Append('&amp;');
236-
DOUBLEQUOTE:
237-
SB.Append('&quot;');
238-
#0..#9, #11, #12, #14..#31:
239-
SB.Append('&#' + IntToStr(Ord(Ch)) + ';')
240-
else
241-
SB.Append(Ch);
230+
LT: SB.Append('&lt;');
231+
GT: SB.Append('&gt;');
232+
SINGLEQUOTE: SB.Append('&apos;');
233+
DOUBLEQUOTE: SB.Append('&quot;');
234+
AMPERSAND: SB.Append('&amp;');
235+
else SB.Append(Ch);
242236
end;
243237
end;
244238
Result := SB.ToString;

Src/VCodeSnip.vi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
[Fixed File Info]
11-
File Version #=4, 18, 0, 261
12-
Product Version #=4, 18, 0, 0
11+
File Version #=4, 18, 1, 262
12+
Product Version #=4, 18, 1, 0
1313
File OS=4
1414
File Type=1
1515
File Sub-Type=0

Src/VCodeSnipPortable.vi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
[Fixed File Info]
11-
File Version #=4, 18, 0, 261
12-
Product Version #=4, 18, 0, 0
11+
File Version #=4, 18, 1, 262
12+
Product Version #=4, 18, 1, 0
1313
File OS=4
1414
File Type=1
1515
File Sub-Type=0

0 commit comments

Comments
 (0)