Skip to content

Commit

Permalink
Multiple fixes to allow help integration in Delphi XE5
Browse files Browse the repository at this point in the history
Fixed StrToStrings and StrIToStrings in JclAnsiStrings.pas (back ported from JcStrings.pas)
Updated JclSysutils.pas so StrToStrings is called explicitely with AllowString = False< (this was causing help registration failures following the StrToStrings fix)
  • Loading branch information
cycocrew committed Nov 2, 2013
1 parent c6cba78 commit e694653
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
11 changes: 6 additions & 5 deletions jcl/install/JclInstall.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
{ Copyright (C) of Petr Vones. All Rights Reserved. }
{ }
{ Contributor(s): }
{ - Robert Rossmair - crossplatform & BCB support, refactoring }
{ - Florent Ouchet (outchy) - New installer core }
{ - Resource refactorings }
{ Robert Rossmair - crossplatform & BCB support, refactoring }
{ Florent Ouchet (outchy) - New installer core, resource refactorings }
{ Jean-Fabien Connault (cycocrew) }
{ }
{**************************************************************************************************}
{ }
Expand Down Expand Up @@ -3716,8 +3716,9 @@ function TJclDistribution.RegHelpExecuteCommands(DisplayErrors: Boolean): Boolea
if Assigned(GUI) and not IsElevated then
GUI.Dialog(LoadResString(@RsHTMLHelp2Credentials), dtInformation, [drOK]);

// RegHelper.exe manifest requires elevation on Vista
if IsAdministrator or IsWinVista or IsWinServer2008 or IsWin7 or IsWinServer2008R2 then
// RegHelper.exe manifest requires elevation on Windows Vista/7/8/8.1 and Windows Server 2008/2008R2/2012/2012R2
if IsAdministrator or IsWinVista or IsWinServer2008 or IsWin7 or IsWinServer2008R2 or
IsWin8 or IsWinServer2012 or IsWin81 or IsWinServer2012R2 then
Verb := 'open'
else
Verb := 'runas';
Expand Down
8 changes: 4 additions & 4 deletions jcl/install/JclInstallResources.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
{ Copyright (C) of Petr Vones. All Rights Reserved. }
{ }
{ Contributor(s): }
{ - Robert Rossmair - crossplatform & BCB support, refactoring }
{ - Florent Ouchet (outchy) - New installer core }
{ - Resource refactorings }
{ Robert Rossmair - crossplatform & BCB support, refactoring }
{ Florent Ouchet (outchy) - New installer core, resource refactorings }
{ Jean-Fabien Connault (cycocrew) }
{ }
{**************************************************************************************************}
{ }
Expand Down Expand Up @@ -162,7 +162,7 @@ interface
RsCaptionHelpHlp = 'Add help file to IDE help system';
RsCaptionHelpChm = 'Add HTML help to the Tools menu';
RsCaptionHelpHxS = 'Register help 2.0 files';
RsCaptionHelpHxSPlugin = 'Plug help 2.0 files in the Borland help system';
RsCaptionHelpHxSPlugin = 'Plug help 2.0 files in the Embarcadero help system';

// demos
RsCaptionMakeDemos = 'Make demos';
Expand Down
5 changes: 3 additions & 2 deletions jcl/install/RegHelper.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{ Portions created by Florent Ouchet are Copyright (C) of Florent Ouchet. All Rights Reserved. }
{ }
{ Contributor(s): }
{ Jean-Fabien Connault (cycocrew) }
{ }
{**************************************************************************************************}
{ }
Expand Down Expand Up @@ -181,7 +182,7 @@ var
procedure DisplayCopyright;
begin
WriteLn(RegHelperOutput,'HTML Help 2.0 registration helper');
WriteLn(RegHelperOutput,'Copyright (c) 2007 Project JEDI');
WriteLn(RegHelperOutput,'Copyright (c) 2007-2013 Project JEDI');
WriteLn(RegHelperOutput,'');
end;

Expand Down Expand Up @@ -258,7 +259,7 @@ function ParseArguments: Boolean;
end
else
begin
WriteLn(RegHelperOutput,'Error: Number of parameter is invalid for command: ', Argument);
WriteLn(RegHelperOutput, 'Error: Number of parameters (' + intToStr(ParamCount) + ' found instead of ' + intToStr(CommandRecs[IndexCommand].ParamCount) + ' expected) is invalid for command: ', Argument);
Result := False;
Exit;
end;
Expand Down
8 changes: 4 additions & 4 deletions jcl/source/common/JclAnsiStrings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3485,8 +3485,8 @@ procedure StrToStrings(S, Sep: AnsiString; const List: TJclAnsiStrings; const Al
Delete(S, 1, I + L - 1);
I := Pos(Sep, S);
end;
if S <> '' then
List.Add(S); // Ignore empty strings at the end.
if (S <> '') or AllowEmptyString then
List.Add(S); // Ignore empty strings at the end (only if AllowEmptyString = False).
finally
List.EndUpdate;
end;
Expand Down Expand Up @@ -3515,8 +3515,8 @@ procedure StrIToStrings(S, Sep: AnsiString; const List: TJclAnsiStrings; const A
Delete(LowerCaseStr, 1, I + L - 1);
I := Pos(Sep, LowerCaseStr);
end;
if S <> '' then
List.Add(S); // Ignore empty strings at the end.
if (S <> '') or AllowEmptyString then
List.Add(S); // Ignore empty strings at the end (only if AllowEmptyString = False).
finally
List.EndUpdate;
end;
Expand Down
18 changes: 9 additions & 9 deletions jcl/source/common/JclSysUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3562,7 +3562,7 @@ procedure ListAddItems(var List: string; const Separator, Items: string);
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

NewItems := TStringList.Create;
try
Expand All @@ -3589,7 +3589,7 @@ procedure ListIncludeItems(var List: string; const Separator, Items: string);
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

NewItems := TStringList.Create;
try
Expand Down Expand Up @@ -3620,11 +3620,11 @@ procedure ListRemoveItems(var List: string; const Separator, Items: string);
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

RemItems := TStringList.Create;
try
StrToStrings(Items, Separator, RemItems);
StrToStrings(Items, Separator, RemItems, False);

for Index := 0 to RemItems.Count - 1 do
begin
Expand Down Expand Up @@ -3652,7 +3652,7 @@ procedure ListDelItem(var List: string; const Separator: string; const Index: In
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

StrList.Delete(Index);

Expand All @@ -3669,7 +3669,7 @@ function ListItemCount(const List, Separator: string): Integer;
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

Result := StrList.Count;
finally
Expand All @@ -3684,7 +3684,7 @@ function ListGetItem(const List, Separator: string; const Index: Integer): strin
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

Result := StrList.Strings[Index];
finally
Expand All @@ -3700,7 +3700,7 @@ procedure ListSetItem(var List: string; const Separator: string;
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

StrList.Strings[Index] := Value;

Expand All @@ -3717,7 +3717,7 @@ function ListItemIndex(const List, Separator, Item: string): Integer;
begin
StrList := TStringList.Create;
try
StrToStrings(List, Separator, StrList);
StrToStrings(List, Separator, StrList, False);

Result := StrList.IndexOf(Item);
finally
Expand Down
8 changes: 7 additions & 1 deletion jcl/source/windows/JclHelpUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TJclHelp2Manager = class
RCSfile: '$URL$';
Revision: '$Revision$';
Date: '$Date$';
LogPath: 'JCL\source\windows';
LogPath: 'jcl\source\windows';
Extra: '';
Data: nil
);
Expand Down Expand Up @@ -314,6 +314,12 @@ constructor TJclHelp2Manager.Create(IDEVersionNumber: Integer);
FHxPlugin := nil;
if IDEVersionNumber > 0 then
begin
if (IDEVersionNumber = 12) then
FIdeNameSpace := 'embarcadero.rs_xe5'
else
if (IDEVersionNumber = 11) then
FIdeNameSpace := 'embarcadero.rs_xe4'
else
if (IDEVersionNumber = 10) then
FIdeNameSpace := 'embarcadero.rs_xe3'
else
Expand Down

0 comments on commit e694653

Please sign in to comment.