mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-26 15:41:36 +01:00
* 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:
parent
dacfafbe65
commit
b25ed48f65
@ -142,8 +142,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChmHelpViewer.SetHelpLabel(AValue: String);
|
procedure TChmHelpViewer.SetHelpLabel(AValue: String);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
fHelpLabel := AValue;
|
fHelpLabel := AValue;
|
||||||
|
for i := 1 to Length(fHelpLabel) do
|
||||||
|
if not (fHelpLabel[i] in ['a'..'z', '0'..'9', 'A'..'Z']) then
|
||||||
|
fHelpLabel[i] := '_';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TChmHelpViewer.CheckBuildLHelp: Integer;
|
function TChmHelpViewer.CheckBuildLHelp: Integer;
|
||||||
@ -360,7 +365,7 @@ begin
|
|||||||
else
|
else
|
||||||
DocsDir := fChmsFilePath;
|
DocsDir := fChmsFilePath;
|
||||||
|
|
||||||
FileName := DocsDir+FileName;
|
FileName := IncludeTrailingPathDelimiter(DocsDir)+FileName;
|
||||||
|
|
||||||
fHelpConnection.StartHelpServer(HelpLabel, HelpExe);
|
fHelpConnection.StartHelpServer(HelpLabel, HelpExe);
|
||||||
Res := fHelpConnection.OpenURL(FileName, Url);
|
Res := fHelpConnection.OpenURL(FileName, Url);
|
||||||
@ -384,7 +389,7 @@ begin
|
|||||||
Viewer:=TChmHelpViewer(Source);
|
Viewer:=TChmHelpViewer(Source);
|
||||||
HelpEXE:=Viewer.HelpEXE;
|
HelpEXE:=Viewer.HelpEXE;
|
||||||
HelpLabel:=Viewer.HelpLabel;
|
HelpLabel:=Viewer.HelpLabel;
|
||||||
HelpFilesPath:=IncludeTrailingPathDelimiter(Viewer.HelpFilesPath);
|
HelpFilesPath:=Viewer.HelpFilesPath;
|
||||||
end;
|
end;
|
||||||
inherited Assign(Source);
|
inherited Assign(Source);
|
||||||
end;
|
end;
|
||||||
@ -393,7 +398,7 @@ procedure TChmHelpViewer.Load(Storage: TConfigStorage);
|
|||||||
begin
|
begin
|
||||||
HelpEXE:=Storage.GetValue('CHMHelp/Exe','');
|
HelpEXE:=Storage.GetValue('CHMHelp/Exe','');
|
||||||
HelpLabel:=Storage.GetValue('CHMHelp/Name','lazhelp');
|
HelpLabel:=Storage.GetValue('CHMHelp/Name','lazhelp');
|
||||||
HelpFilesPath := IncludeTrailingPathDelimiter(Storage.GetValue('CHMHelp/FilesPath',''));
|
HelpFilesPath := Storage.GetValue('CHMHelp/FilesPath','');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChmHelpViewer.Save(Storage: TConfigStorage);
|
procedure TChmHelpViewer.Save(Storage: TConfigStorage);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user