* dom.pp: clean up

git-svn-id: trunk@14362 -
This commit is contained in:
sergei 2009-12-08 09:09:23 +00:00
parent c8efa67ac7
commit 14d42da206

View File

@ -2166,13 +2166,9 @@ begin
ID := Attr.Value;
p := FIDList.FindOrAdd(DOMPChar(ID), Length(ID), Exists);
if not Exists then
begin
Result := not Exists;
if Result then
p^.Data := Attr.OwnerElement;
Result := True;
end
else
Result := False;
end;
// This shouldn't be called if document has no IDs,
@ -2951,14 +2947,9 @@ end;
function TDOMElement.RemoveAttributeNode(OldAttr: TDOMAttr): TDOMAttr;
begin
Changing;
Result:=nil;
// TODO: DOM 2: must raise NOT_FOUND_ERR if OldAttr is not ours.
// -- but what is the purpose of return value then?
// TODO: delegate to TNamedNodeMap? Nope, it does not have such method
// (note) one way around is to remove by name
Result:=OldAttr;
if Assigned(FAttributes) and (FAttributes.FList.Remove(OldAttr) > -1) then
begin
Result := OldAttr;
if Assigned(OldAttr.FNSI.QName) then // safeguard
FAttributes.RestoreDefault(OldAttr.FNSI.QName^.Key);
Result.FOwnerElement := nil;