386,8 → 386,7 |
|
CreateOidDef(newOID); |
newOID^.FileId := NextPossibleFileID; |
newOID^.ParentFileId := oid^.FileId; |
newOID^.ParentDotNotation := oid^.DotNotation; |
newOID^.Parent := oid^.FileId + oid^.DotNotation; |
if NumIdEditor(newOID, oid) and |
AsnEditor(newOID) and |
DescEditor(newOID) then |
416,8 → 415,7 |
begin |
CreateOidDef(childOID); |
if _ReadOidFile(filenameChild, childOID, false) and |
(childOID^.ParentFileId = oid^.FileId) and |
(childOID^.ParentDotNotation = oid^.DotNotation) then |
(childOID^.Parent = oid^.FileId + oid^.DotNotation) then |
begin |
DeleteChildrenRecursive(childOID); |
end; |
439,7 → 437,7 |
|
(* Remove forward reference in parent OID *) |
(* (this is the most important part) *) |
filenameParent := selfOID^.ParentFileId + OID_EXTENSION; |
filenameParent := FileIdPart(selfOID^.Parent) + OID_EXTENSION; |
if FileExists(filenameParent) then |
begin |
CreateOidDef(parentOID); |
577,29 → 575,30 |
CreateList(subsel); (* Contains the human-readable OID name *) |
CreateList(subfiles); (* Contains the file name *) |
|
if oid^.ParentFileId = '' then |
if oid^.Parent = '' then |
begin |
isRoot := true; |
end |
else |
begin |
isRoot := oid^.ParentDotNotation = oid^.DotNotation; |
isRoot := DotNotationPart(oid^.Parent) = oid^.DotNotation; |
end; |
|
if (oid^.ParentFileId <> '') and not isRoot then |
if (oid^.Parent <> '') and not isRoot then |
begin |
subfile := oid^.ParentFileId + OID_EXTENSION; |
sTmp := oid^.Parent; |
subfile := FileIdPart(sTmp) + OID_EXTENSION; |
if FileExists(subfile) then |
begin |
CreateOidDef(tmpOID); |
if not _ReadOidFile(subfile, tmpOID, true) then |
begin |
ListAppend(subsel, 'Go to parent ' + oid^.ParentDotNotation + ' (READ ERROR)'); |
ListAppend(subsel, 'Go to parent ' + DotNotationPart(sTmp) + ' (READ ERROR)'); |
ListAppend(subfiles, 'ERROR: '+subfile+' Read error or file invalid'); |
end |
else |
begin |
ListAppend(subsel, 'Go to parent ' + oid^.ParentDotNotation + _ShowASNIds(tmpOID)); |
ListAppend(subsel, 'Go to parent ' + DotNotationPart(sTmp) + _ShowASNIds(tmpOID)); |
ListAppend(subfiles, subfile); |
end; |
FreeOidDef(tmpOID); |
606,7 → 605,7 |
end |
else |
begin |
ListAppend(subsel, 'Go to parent ' + oid^.ParentDotNotation + ' (FILE NOT FOUND)'); |
ListAppend(subsel, 'Go to parent ' + DotNotationPart(sTmp) + ' (FILE NOT FOUND)'); |
ListAppend(subfiles, 'ERROR: File '+subfile+' was not found'); |
end; |
end; |
630,8 → 629,7 |
ListAppend(subsel, 'Go to child ' + DotNotationPart(sTmp) + ' (READ ERROR)'); |
ListAppend(subfiles, 'ERROR: Read error at file '+subfile+', or file is invalid.'); |
end |
else if (tmpOID^.ParentFileId <> oid^.FileId) or |
(tmpOID^.ParentDotNotation <> oid^.DotNotation) then |
else if tmpOID^.Parent <> oid^.FileId + oid^.DotNotation then |
begin |
ListAppend(subsel, 'Go to child ' + DotNotationPart(sTmp) + ' (BAD BACKREF)'); |
ListAppend(subfiles, 'ERROR: File '+subfile+' has a wrong back-reference.'); |
705,7 → 703,7 |
begin |
if _DeleteConfirmation then |
begin |
sTmp := oid^.ParentFileId + OID_EXTENSION; |
sTmp := FileIdPart(oid^.Parent) + OID_EXTENSION; |
DeleteOidRecursive(oid); |
if FileExists(sTmp) then |
begin |
759,8 → 757,7 |
'- 2 (joint-iso-itu-t)'; |
oid^.FileId := ZeroPad(0, 8); |
oid^.DotNotation := ''; |
oid^.ParentFileId := ZeroPad(0, 8); |
oid^.ParentDotNotation := ''; |
oid^.Parent := ZeroPad(0, 8); |
CreateRootOIDFile := _WriteOidFile(filename, oid, ShowErrorMessage); |
FreeOidDef(oid); |
end; |
869,8 → 866,7 |
sTmp := TrimLineToWidth(sTmp, TREEVIEW_WIDTH); |
WriteLn(F, sTmp); |
end |
else if (suboid^.ParentFileId <> oid^.FileId) or |
(suboid^.ParentDotNotation <> oid^.DotNotation) then |
else if suboid^.Parent <> oid^.FileId + oid^.DotNotation then |
begin |
(* This can happen if a file is missing, and then another OID gets this filename since the number seems to be free *) |
sTmp := 'ERROR: BAD BACKREF AT ' + childFilename + ' (SHALL CONTAIN ' + DotNotationPart(sTmp) + ')!'; |