Bladeren bron

* dom.pp: clean up

git-svn-id: trunk@14362 -
sergei 15 jaren geleden
bovenliggende
commit
14d42da206
1 gewijzigde bestanden met toevoegingen van 3 en 12 verwijderingen
  1. 3 12
      packages/fcl-xml/src/dom.pp

+ 3 - 12
packages/fcl-xml/src/dom.pp

@@ -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;