Selaa lähdekoodia

* Patch from Sergei Gorelkin:
dom.pp:

* Added a comment about TDOMDocument destruction order.
* Changed declaration of standard namespaces from literals to typed
consts. This makes package operational on arm-wince which has a flaw
in WideString literal assignments (issue #13237).
Even without that bug, the change allows to save some bytes in
executable, because typed consts are only put there once, while
literals are compiled in for every unit that uses them.

htmwrite.pp:

* removed an unused variable

git-svn-id: trunk@12819 -

michael 16 vuotta sitten
vanhempi
commit
c44f0eb6dd
2 muutettua tiedostoa jossa 7 lisäystä ja 9 poistoa
  1. 7 7
      packages/fcl-xml/src/dom.pp
  2. 0 2
      packages/fcl-xml/src/htmwrite.pp

+ 7 - 7
packages/fcl-xml/src/dom.pp

@@ -85,11 +85,6 @@ const
   DOCUMENT_FRAGMENT_NODE = 11;
   NOTATION_NODE = 12;
 
-// URIs of predefined namespaces
-  stduri_xml = 'http://www.w3.org/XML/1998/namespace';
-  stduri_xmlns = 'http://www.w3.org/2000/xmlns/';
-
-
 type
   TDOMImplementation = class;
   TDOMDocumentFragment = class;
@@ -724,6 +719,10 @@ type
     property Data: DOMString read FNodeValue write SetNodeValue;
   end;
 
+// URIs of predefined namespaces
+const
+  stduri_xml: DOMString = 'http://www.w3.org/XML/1998/namespace';
+  stduri_xmlns: DOMString = 'http://www.w3.org/2000/xmlns/';
 
 
 
@@ -1785,9 +1784,10 @@ end;
 
 destructor TDOMDocument.Destroy;
 begin
-  FreeAndNil(FIDList);   // set to nil before starting destroying chidlren
+  FreeAndNil(FIDList);   // set to nil before starting destroying children
   inherited Destroy;
-  FNames.Free;
+  FNames.Free;           // free the nametable after inherited has destroyed the children
+                         // (because children reference the nametable)
 end;
 
 function TDOMDocument.AddID(Attr: TDOMAttr): Boolean;

+ 0 - 2
packages/fcl-xml/src/htmwrite.pp

@@ -139,8 +139,6 @@ end;
   ---------------------------------------------------------------------}
 
 constructor THTMLWriter.Create;
-var
-  I: Integer;
 begin
   inherited Create;
   // some overhead - always be able to write at least one extra UCS4