* fixed bug #16988 where setting the help label to a char other than a..z, a..z 0..9 would crash lazarus.

* also fixed a bug where if HelpFilesPath was left blank a PathDelimiter would be added resulting in a HelpFilesPath of "/"

git-svn-id: trunk@26757 -
This commit is contained in:
andrew 2010-07-20 23:24:10 +00:00
parent dacfafbe65
commit b25ed48f65

View File

@ -142,8 +142,13 @@ begin
end;
procedure TChmHelpViewer.SetHelpLabel(AValue: String);
var
i: Integer;
begin
fHelpLabel := AValue;
for i := 1 to Length(fHelpLabel) do
if not (fHelpLabel[i] in ['a'..'z', '0'..'9', 'A'..'Z']) then
fHelpLabel[i] := '_';
end;
function TChmHelpViewer.CheckBuildLHelp: Integer;
@ -360,7 +365,7 @@ begin
else
DocsDir := fChmsFilePath;
FileName := DocsDir+FileName;
FileName := IncludeTrailingPathDelimiter(DocsDir)+FileName;
fHelpConnection.StartHelpServer(HelpLabel, HelpExe);
Res := fHelpConnection.OpenURL(FileName, Url);
@ -384,7 +389,7 @@ begin
Viewer:=TChmHelpViewer(Source);
HelpEXE:=Viewer.HelpEXE;
HelpLabel:=Viewer.HelpLabel;
HelpFilesPath:=IncludeTrailingPathDelimiter(Viewer.HelpFilesPath);
HelpFilesPath:=Viewer.HelpFilesPath;
end;
inherited Assign(Source);
end;
@ -393,7 +398,7 @@ procedure TChmHelpViewer.Load(Storage: TConfigStorage);
begin
HelpEXE:=Storage.GetValue('CHMHelp/Exe','');
HelpLabel:=Storage.GetValue('CHMHelp/Name','lazhelp');
HelpFilesPath := IncludeTrailingPathDelimiter(Storage.GetValue('CHMHelp/FilesPath',''));
HelpFilesPath := Storage.GetValue('CHMHelp/FilesPath','');
end;
procedure TChmHelpViewer.Save(Storage: TConfigStorage);