diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-14 19:58:50 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-14 19:58:50 +0200 |
commit | fd0c4577a4b6e85ca2db664906e1a03807ce133f (patch) | |
tree | fa23fcc04248d03ff82e34634b8ef1bb9cf28acb /tex/context/base/mkiv/lpdf-fld.lua | |
parent | db581096187dc2d3cbdbe4cdc39d247c168b1607 (diff) | |
download | context-fd0c4577a4b6e85ca2db664906e1a03807ce133f.tar.gz |
2017-05-14 19:15:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-fld.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-fld.lua | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/lpdf-fld.lua b/tex/context/base/mkiv/lpdf-fld.lua index 75d0ba98e..bbafb299b 100644 --- a/tex/context/base/mkiv/lpdf-fld.lua +++ b/tex/context/base/mkiv/lpdf-fld.lua @@ -58,9 +58,8 @@ if not modules then modules = { } end modules ['lpdf-fld'] = { local tostring, next = tostring, next local gmatch, lower, format, formatters = string.gmatch, string.lower, string.format, string.formatters local lpegmatch = lpeg.match -local utfchar = utf.char local bpfactor, todimen = number.dimenfactors.bp, string.todimen - +local sortedhash = table.sortedhash local trace_fields = false trackers.register("backends.fields", function(v) trace_fields = v end) local report_fields = logs.reporter("backend","fields") @@ -88,7 +87,6 @@ local pdfreference = lpdf.reference local pdfunicode = lpdf.unicode local pdfstring = lpdf.string local pdfconstant = lpdf.constant -local pdftoeight = lpdf.toeight local pdfflushobject = lpdf.flushobject local pdfshareobjectreference = lpdf.shareobjectreference local pdfshareobject = lpdf.shareobject @@ -249,7 +247,7 @@ local mapping = { local function fieldactions(specification) -- share actions local d = nil - for key, target in next, mapping do + for key, target in sortedhash(mapping) do -- sort so that we can compare pdf local code = specification[key] if code and code ~= "" then -- local a = checked(code) @@ -367,7 +365,8 @@ local function registerfonts() checkpdfdocencoding() -- already done local d = pdfdictionary() local pdffonttype, pdffontsubtype = pdfconstant("Font"), pdfconstant("Type1") - for tag, name in next, usedfonts do + -- for tag, name in next, usedfonts do + for tag, name in sortedhash(usedfonts) do local f = pdfdictionary { Type = pdffonttype, Subtype = pdffontsubtype, @@ -655,7 +654,7 @@ local xfdftemplate = [[ function codeinjections.exportformdata(name) local result = { } - for k, v in table.sortedhash(fields) do + for k, v in sortedhash(fields) do result[#result+1] = formatters[" <field name='%s'><value>%s</value></field>"](v.name or k,v.default or "") end local base = file.basename(tex.jobname) @@ -880,7 +879,7 @@ local forceencoding = false local function finishfields() local sometext = forceencoding - for name, field in next, fields do + for name, field in sortedhash(fields) do local kids = field.kids if kids then pdfflushobject(field.kidsnum,kids) @@ -894,7 +893,7 @@ local function finishfields() sometext = true end end - for name, field in next, radios do + for name, field in sortedhash(radios) do local kids = field.kids if kids then pdfflushobject(field.kidsnum,kids) |