Skip to content

Commit ab67590

Browse files
committed
Merged revision(s) 3579-3682, 3462-3579 from tags/version-4.8.2:
This updates the trunk with changes made in release 4.8.2.
1 parent 8de9840 commit ab67590

File tree

5 files changed

+56
-19
lines changed

5 files changed

+56
-19
lines changed

Docs/ChangeLogs/ChangeLog-v4.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
; Change Log for CodeSnip Release 4
1212
; ------------------------------------------------------------------------------
1313

14+
Release v4.8.2 of 30 October 2013
15+
+ Modified Syntax Highlighter tab of Preferences dialogue box so that "vertical" fonts (whose names begin with "@") no longer appear in list of available fonts.
16+
+ Fixed potential bug in operating system detection code that may fail on Windows 2000.
17+
1418
Release v4.8.1 of 18 September 2013
1519
+ Removed File | Page Setup menu option because some settings made there were being ignored when a file was printed. This is a fix for bug #89 "Setup selections not being remembered" (http://bit.ly/1a3V94x).
1620
+ Updated help file re changes.

Src/3rdParty/PJSysInfo.pas

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,31 @@ function GetEnvVar(const VarName: string): string;
983983
Result := '';
984984
end;
985985

986-
// Creates a read only TRegistry instance. On versions of Delphi that don't
987-
// support passing access flags to TRegistry constructor, registry is opened
988-
// normally for read/write access.
986+
// Checks if host OS is Windows 2000 or earlier, included any Win9x OS.
987+
// This is a helper function for RegCreate and RegOpenKeyReadOnly and avoids
988+
// avoids using TPJOSInfo to ensure that an infinite loop is not set up with
989+
// TPJOSInfo calling back into RegCreate.
990+
function IsWin2000OrEarlier: Boolean;
991+
begin
992+
// NOTE: all Win9x OSs have Win32MajorVersion < 5, so we don't need to check
993+
// platform.
994+
Result := (Win32MajorVersion < 5) or
995+
((Win32MajorVersion = 5) and (Win32MinorVersion = 0));
996+
end;
997+
998+
// Creates a read only TRegistry instance. On versions of Delphi or OSs that
999+
// don't support passing access flags to TRegistry constructor, registry is
1000+
// opened normally for read/write access.
9891001
function RegCreate: TRegistry;
9901002
begin
9911003
{$IFDEF REGACCESSFLAGS}
992-
//! fix for issue #14 (http://bit.ly/eWkw9X) suggested by Steffen Schaff
993-
Result := TRegistry.Create(KEY_READ or KEY_WOW64_64KEY);
1004+
//! Fix for issue #14 (http://bit.ly/eWkw9X) suggested by Steffen Schaff.
1005+
//! Later modified to allow for fact that Windows 2000 fails if
1006+
//! KEY_WOW64_64KEY is used.
1007+
if IsWin2000OrEarlier then
1008+
Result := TRegistry.Create
1009+
else
1010+
Result := TRegistry.Create(KEY_READ or KEY_WOW64_64KEY);
9941011
{$ELSE}
9951012
Result := TRegistry.Create;
9961013
{$ENDIF}
@@ -999,19 +1016,32 @@ function RegCreate: TRegistry;
9991016
// Uses registry object to open a key as read only. On versions of Delphi that
10001017
// can't open keys as read only the key is opened normally.
10011018
function RegOpenKeyReadOnly(const Reg: TRegistry; const Key: string): Boolean;
1019+
1020+
// Opens registry key using TRegistry.OpenKeyReadOnly if supported, otherwise
1021+
// uses TRegistry.OpenKey.
1022+
function TryOpenKeyReadOnly: Boolean;
1023+
begin
1024+
{$IFDEF REGOPENREADONLY}
1025+
Result := Reg.OpenKeyReadOnly(Key);
1026+
{$ELSE}
1027+
Result := Reg.OpenKey(Key, False);
1028+
{$ENDIF}
1029+
end;
1030+
10021031
begin
10031032
{$IFDEF REGACCESSFLAGS}
1004-
//! Fix for problem with OpenKeyReadOnly on 64 bit Windows
1005-
//! requires Reg has (KEY_READ or KEY_WOW64_64KEY) access flags
1006-
Result := Reg.OpenKey(Key, False);
1033+
//! Fix for problem with OpenKeyReadOnly on 64 bit Windows requires Reg has
1034+
//! (KEY_READ or KEY_WOW64_64KEY) access flags.
1035+
//! Even though these flags aren't provided on Windows 2000 and earlier, the
1036+
//! following code should still work
1037+
if IsWin2000OrEarlier then
1038+
Result := TryOpenKeyReadOnly
1039+
else
1040+
Result := Reg.OpenKey(Key, False);
10071041
{$ELSE}
10081042
// Can't fix Win 64 problem since this version of Delphi does not support
10091043
// customisation of registry access flags.
1010-
{$IFDEF REGOPENREADONLY}
1011-
Result := Reg.OpenKeyReadOnly(Key);
1012-
{$ELSE}
1013-
Result := Reg.OpenKey(Key, False);
1014-
{$ENDIF}
1044+
Result := TryOpenKeyReadOnly;
10151045
{$ENDIF}
10161046
end;
10171047

Src/UFontHelper.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ implementation
109109
// Delphi
110110
SysUtils, Windows, Forms,
111111
// Project
112-
UGraphicUtils, USystemInfo;
112+
UGraphicUtils, UStrUtils, USystemInfo;
113113

114114

115115
{ TFontHelper }
@@ -123,7 +123,10 @@ function MonoFontFamilyProc(PLF: PEnumLogFont; PNTM: PNewTextMetric;
123123
@param List [in] List to which mono-spaced fonts are added.
124124
}
125125
begin
126-
if (PLF.elfLogFont.lfPitchAndFamily and $F) = FIXED_PITCH then
126+
// check for fixed pitch font and filter out all "vertical" fonts that start
127+
// with "@" (see http://tinyurl.com/6ul6rfo for details of vertical fonts).
128+
if ((PLF.elfLogFont.lfPitchAndFamily and $F) = FIXED_PITCH)
129+
and not StrStartsStr('@', PLF.elfLogFont.lfFaceName) then
127130
List.Add(PLF.elfLogFont.lfFaceName);
128131
Result := 1;
129132
end;

Src/VCodeSnip.vi

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

1212

1313
[Fixed File Info]
14-
File Version #=4, 8, 1, 238
15-
Product Version #=4, 8, 1, 0
14+
File Version #=4, 8, 2, 239
15+
Product Version #=4, 8, 2, 0
1616
File OS=4
1717
File Type=1
1818
File Sub-Type=0

Src/VCodeSnipPortable.vi

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

1212

1313
[Fixed File Info]
14-
File Version #=4, 8, 1, 238
15-
Product Version #=4, 8, 1, 0
14+
File Version #=4, 8, 2, 239
15+
Product Version #=4, 8, 2, 0
1616
File OS=4
1717
File Type=1
1818
File Sub-Type=0

0 commit comments

Comments
 (0)