function TMoveHistory.pushItem( item: TBrowserRecord): Integer;
var
history : TMoveHistoryItem;
- doc : OleVariant;
+ doc : IHTMLDocument2;
begin
Result := -1;
- if ( item <> nil ) and ( item.Thread <> nil )
- and ( item.Browser <> nil) then begin
- history := TMoveHistoryItem.Create;
- history.FThreadItem := item.Thread;
- doc := Idispatch( olevariant(item.Browser.ControlInterface).Document) as IHTMLDocument2;
- history.ScrollTop := doc.Body.ScrollTop;
+ if not Assigned(item) then
+ Exit;
+ if not Assigned(item.Thread) then
+ Exit;
+ if not Assigned(item.Browser) then
+ Exit;
- Result := pushItem( history );
- end;
+ doc := item.Browser.ControlInterface.Document as IHTMLDocument2;
+ if not Assigned(doc) then
+ Exit;
+
+ history := TMoveHistoryItem.Create;
+ history.FThreadItem := item.Thread;
+
+ history.ScrollTop := (doc.body as IHTMLElement2).ScrollTop;
+
+ Result := pushItem( history );
end;
//! \88ê\82Â\91O\82Ì\97\9a\97ð\83A\83C\83e\83\80\8eæ\93¾
function TMoveHistory.getPrevItem(item: TBrowserRecord): TMoveHistoryItem;