tpipro, don't use dataprovider for embedded style, silently skip unavailable resources

git-svn-id: trunk@13929 -
This commit is contained in:
jesus 2008-01-31 07:43:35 +00:00
parent 1802d34238
commit c8cf0b9a9f
2 changed files with 11 additions and 8 deletions

View File

@ -354,7 +354,12 @@ begin
IpParseURL(URL, FileAddrRec);
FN := NetToDosPath(FileAddrRec.Path);
Result := TMemoryStream.Create;
TMemoryStream(Result).LoadFromFile(FN);
try
TMemoryStream(Result).LoadFromFile(FN);
except
Result.Free;
Result:=nil;
end;
Finalize(FileAddrRec);
end;
{$ENDIF}

View File

@ -6765,16 +6765,14 @@ procedure TIpHtml.ParseStyleSheet(Parent: TIpHtmlNode; HRef: String);
var
StyleStream: TStream;
begin
if FDataProvider = nil then begin
//DebugLn('No dataprovider!');
exit;
end;
StyleStream:=nil;
if Parent is TIpHtmlNodeHEAD then begin
Href := FDataProvider.BuildURL(CurURL, HRef);
StyleStream := FDataProvider.DoGetStream(HRef);
if FDataProvider<>nil then begin
Href := FDataProvider.BuildURL(CurURL, HRef);
StyleStream := FDataProvider.DoGetStream(HRef);
end;
end else
if Parent is TIpHtmlNodeSTYLE then
StyleStream := TStringStream.Create(Href);