simplify rels scan (fixes #2537)

This commit is contained in:
reviewher 2022-03-01 04:14:41 -05:00 committed by GitHub
parent 56e23ca8e0
commit 4f6a849a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,7 +61,9 @@ var RELS_EXTERN = [RELS.HLINK, RELS.XPATH, RELS.XMISS];
function add_rels(rels, rId/*:number*/, f, type, relobj, targetmode/*:?string*/)/*:number*/ {
if(!relobj) relobj = {};
if(!rels['!id']) rels['!id'] = {};
if(rId < 0) for(rId = 1; rels['!id']['rId' + rId]; ++rId){/* empty */}
if(!rels['!idx']) rels['!idx'] = 1;
if(rId < 0) for(rId = rels['!idx']; rels['!id']['rId' + rId]; ++rId){/* empty */}
rels['!idx'] = rId + 1;
relobj.Id = 'rId' + rId;
relobj.Type = type;
relobj.Target = f;