diff --git a/components/lazutils/asiancodepagefunctions.inc b/components/lazutils/asiancodepagefunctions.inc index 5b81ff28f1..cdad38e230 100644 --- a/components/lazutils/asiancodepagefunctions.inc +++ b/components/lazutils/asiancodepagefunctions.inc @@ -87,7 +87,7 @@ begin end; end; end; - SetLength(Result, PtrUInt(Dest) - PtrUInt(Result)); + SetLength(Result, {%H-}PtrUInt(Dest) - PtrUInt(Result)); end; function CP936ToUTF8(const s: string): string; @@ -198,7 +198,7 @@ begin end; end; //SetLength(Result, Dest - PChar(Result)); - SetLength(Result, PtrUInt(Dest) - PtrUInt(Result)); + SetLength(Result, {%H-}PtrUInt(Dest) - PtrUInt(Result)); end; function UTF8ToCP936(const s: string): string; diff --git a/components/lazutils/laz_xmlread.pas b/components/lazutils/laz_xmlread.pas index d675d13f54..f78500bb57 100644 --- a/components/lazutils/laz_xmlread.pas +++ b/components/lazutils/laz_xmlread.pas @@ -216,7 +216,7 @@ type function GetString(BufPos: PChar; Len: integer): String; function CheckName: Boolean; - function GetName(var s: String): Boolean; + function GetName(out s: String): Boolean; function ExpectName: String; // [5] procedure SkipName; procedure ExpectAttValue(attr: TDOMAttr); // [10] @@ -290,8 +290,10 @@ function TXMLReader.BufPosToStr(p: PChar): string; var LineCol: TPoint; begin + if p=0 then begin + // ToDo + end; + if Flags<>[] then begin + // ToDo + end; + StackPush('properties',elPropertyList); end; @@ -536,6 +543,7 @@ end; {$IFDEF HasReadWriteBuf} procedure TXMLObjectWriter.Write(const Buffer; Count: Longint); begin + if Count<=0 then exit; // there can be arbitrary lots of Write calls raise Exception.Create('TODO: TXMLObjectWriter.Write'); end; @@ -911,7 +919,13 @@ var PropertiesNode: TDOMNode; begin //writeln('TXMLObjectReader.BeginComponent START'); - + if AChildPos>0 then begin + // ToDo + end; + if Flags<>[] then begin + // ToDo + end; + if FElement.NodeName='component' then ComponentNode:=FElement else @@ -1009,6 +1023,8 @@ function TXMLObjectReader.ReadIdent(ValueType: TValueType): String; begin Result:=FElement['value']; ReadValue; + // ToDo: check type + if ValueType=vaNull then ; //writeln('TXMLObjectReader.ReadIdent ',Result); end; @@ -1141,6 +1157,8 @@ begin NextNode:=FElement.NextSibling; if (NextNode=nil) or (NextNode is TDOMElement) then FElement:=TDOMElement(NextNode); + // ToDo: SkipComponentInfos + if SkipComponentInfos then ; //writeln('TXMLObjectReader.SkipComponent '); end; @@ -1153,6 +1171,7 @@ end; {$IFDEF HasReadWriteBuf} procedure TXMLObjectReader.Read(var Buf; Count: LongInt); begin + if Count<=0 then exit; raise Exception.Create('TODO: TXMLObjectReader.Read'); //writeln('TXMLObjectReader.Read '); end; diff --git a/components/lazutils/lconvencoding.pas b/components/lazutils/lconvencoding.pas index fa95e63ec8..830abfbfee 100644 --- a/components/lazutils/lconvencoding.pas +++ b/components/lazutils/lconvencoding.pas @@ -4749,7 +4749,7 @@ begin end; end; end; - SetLength(Result,PtrUInt(Dest)-PtrUInt(Result)); + SetLength(Result,{%H-}PtrUInt(Dest)-PtrUInt(Result)); end; function UCS2LEToUTF8(const s: string): string; @@ -4778,7 +4778,7 @@ begin inc(Dest,UnicodeToUTF8SkipErrors(c,Dest)); end; end; - len:=PtrUInt(Dest)-PtrUInt(Result); + len:={%H-}PtrUInt(Dest)-PtrUInt(Result); if len>length(Result) then raise Exception.Create(''); SetLength(Result,len); @@ -4810,7 +4810,7 @@ begin inc(Dest,UnicodeToUTF8SkipErrors(c,Dest)); end; end; - len:=PtrUInt(Dest)-PtrUInt(Result); + len:={%H-}PtrUInt(Dest)-PtrUInt(Result); if len>length(Result) then raise Exception.Create(''); SetLength(Result,len); @@ -6133,7 +6133,7 @@ begin end; end; end; - len:=PtrUInt(Dest)-PtrUInt(Result); + len:={%H-}PtrUInt(Dest)-PtrUInt(Result); if len>length(Result) then raise Exception.Create(''); SetLength(Result,len); @@ -6173,7 +6173,7 @@ begin end; end; end; - len:=PtrUInt(Dest)-PtrUInt(Result); + len:={%H-}PtrUInt(Dest)-PtrUInt(Result); if len>length(Result) then raise Exception.Create(''); SetLength(Result,len);