mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:06:14 +02:00
* Avoid that non-existing parts of version-numbers are replaced by zeros
git-svn-id: trunk@34144 -
This commit is contained in:
parent
62d74cfeb2
commit
8e45ef394e
@ -214,10 +214,14 @@ begin
|
|||||||
If Not Assigned(Parent) then
|
If Not Assigned(Parent) then
|
||||||
Parent:=XML;
|
Parent:=XML;
|
||||||
Parent.AppendChild(Result);
|
Parent.AppendChild(Result);
|
||||||
Result[SAttrMajor]:=IntToStr(V.Major);
|
if V.Major > -1 then
|
||||||
Result[SAttrMinor]:=IntToStr(V.Minor);
|
Result[SAttrMajor]:=IntToStr(V.Major);
|
||||||
|
if V.Minor > -1 then
|
||||||
|
Result[SAttrMinor]:=IntToStr(V.Minor);
|
||||||
|
if V.Micro > -1 then
|
||||||
Result[SAttrMicro]:=IntToStr(V.Micro);
|
Result[SAttrMicro]:=IntToStr(V.Micro);
|
||||||
Result[SAttrBuild]:=IntToStr(V.Build);
|
if V.Build > -1 then
|
||||||
|
Result[SAttrBuild]:=IntToStr(V.Build);
|
||||||
except
|
except
|
||||||
Parent.RemoveChild(Result);
|
Parent.RemoveChild(Result);
|
||||||
Result.Free;
|
Result.Free;
|
||||||
@ -532,11 +536,22 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TFPXMLRepositoryHandler.DoXMLToVersion(E: TDomElement; V: TFPVersion);
|
procedure TFPXMLRepositoryHandler.DoXMLToVersion(E: TDomElement; V: TFPVersion);
|
||||||
|
|
||||||
|
function ReadPart(AttrName: string): Integer;
|
||||||
|
var
|
||||||
|
i: Longint;
|
||||||
|
begin
|
||||||
|
if TryStrToInt(E[AttrName], i) then
|
||||||
|
Result := Abs(i)
|
||||||
|
else
|
||||||
|
Result := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
V.Major:=Abs(StrToIntDef(E[SAttrMajor],0));
|
V.Major := ReadPart(SAttrMajor);
|
||||||
V.Minor:=Abs(StrToIntDef(E[SAttrMinor],0));
|
V.Minor := ReadPart(SAttrMinor);
|
||||||
V.Micro:=Abs(StrToIntDef(E[SAttrMicro],0));
|
V.Micro := ReadPart(SAttrMicro);
|
||||||
V.Build:=Abs(StrToIntDef(E[SAttrBuild],0));
|
V.Build := ReadPart(SAttrBuild);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user