lhelp: fixed updating default title after filling content nodes

git-svn-id: branches/fixes_2_0@63532 -
This commit is contained in:
mattias 2020-07-08 16:37:57 +00:00
parent 90bde32386
commit bee446707f
3 changed files with 41 additions and 39 deletions

View File

@ -31,6 +31,9 @@ uses
// ChmHelp
IpHtml, BaseContentProvider, FileContentProvider, ChmDataProvider, lhelpstrconsts;
const
DefaultCHMContentTitle = '[unknown]';
type
{ TChmContentProvider }
@ -288,6 +291,8 @@ begin
if fUpdateURI <> '' then
DoLoadUri(fUpdateURI);
fUpdateURI:='';
if Title=DefaultCHMContentTitle then
UpdateTitle;
end;
end;
@ -764,7 +769,7 @@ begin
NewTitle := '';
while Item <> nil do
begin
if ITem.Text <> fActiveChmTitle then
if Item.Text <> fActiveChmTitle then
begin
NewTitle:=NewTitle+Item.Text;
if (Item.GetNextSibling <> nil)
@ -778,7 +783,7 @@ begin
NewTitle := FActiveChmTitle + ' [' + NewTitle + ']'
else
NewTitle := FActiveChmTitle;
if NewTitle = '' then NewTitle := '[unknown]';
if NewTitle = '' then NewTitle := DefaultCHMContentTitle;
Title := NewTitle;
end;

View File

@ -629,7 +629,7 @@ begin
if UrlReq.FileRequest.FileName <> '' then
begin
Url := 'file://'+UrlReq.FileRequest.FileName;
Res := OpenUrl(URL+'://'+UrlReq.Url)
Res := OpenUrl(URL+'://'+UrlReq.Url);
end
else
begin

View File

@ -239,10 +239,7 @@ begin
end;
{$IFDEF CHMLOADTIMES}
DebugLn(['CHMLOADTIMES: ',Format('Loading chm files took %d ms',[DateTimeToTimeStamp(Now-StartTime).Time])]);
{$ENDIF}
finally
fHelpConnection.EndUpdate;
CHMFiles.Free;