diff options
author | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
commit | 7d7e0d3c8d778650105cfb479f31a2bb54d69d50 (patch) | |
tree | e0c4e7d8bf466a70af56be02a0de703bbd09a5af /tex/context/base/lpdf-mis.lua | |
parent | b469b8ec1b494ab72cd462bfc539ce01440e6aaf (diff) | |
download | context-7d7e0d3c8d778650105cfb479f31a2bb54d69d50.tar.gz |
beta 2010.08.19 01:08
Diffstat (limited to 'tex/context/base/lpdf-mis.lua')
-rw-r--r-- | tex/context/base/lpdf-mis.lua | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/tex/context/base/lpdf-mis.lua b/tex/context/base/lpdf-mis.lua index 0d9061daa..bdc9147a7 100644 --- a/tex/context/base/lpdf-mis.lua +++ b/tex/context/base/lpdf-mis.lua @@ -20,13 +20,17 @@ local format = string.format local texsprint, texset = tex.sprint, tex.set local ctxcatcodes = tex.ctxcatcodes +local backends, lpdf, nodes = backends, lpdf, nodes + local nodeinjections = backends.pdf.nodeinjections local codeinjections = backends.pdf.codeinjections local registrations = backends.pdf.registrations local copy_node = node.copy -local pdfliteral, register = nodes.pdfliteral, nodes.register +local nodepool = nodes.pool + +local pdfliteral, register = nodepool.pdfliteral, nodepool.register local pdfdictionary = lpdf.dictionary local pdfarray = lpdf.array @@ -180,7 +184,7 @@ function codeinjections.setupidentity(specification) end local function flushjavascripts() - local t = javascripts.flushpreambles() + local t = interactions.javascripts.flushpreambles() if #t > 0 then local a = pdfarray() local pdf_javascript = pdfconstant("JavaScript") @@ -306,26 +310,30 @@ local map = { } local function featurecreep() - local pages, lastconversion, list = jobpages.tobesaved, nil, pdfarray() - local getstructureset = structure.sets.get + local pages, lastconversion, list = structures.pages.tobesaved, nil, pdfarray() + local getstructureset = structures.sets.get for i=1,#pages do local p = pages[i] - local numberdata = p.numberdata - if numberdata then - local conversionset = numberdata.conversionset - if conversionset then - local conversion = getstructureset("structure:conversions",p.block,conversionset,1,"numbers") - if conversion ~= lastconversion then - lastconversion = conversion - list[#list+1] = i - 1 -- pdf starts numbering at 0 - list[#list+1] = pdfdictionary { S = pdfconstant(map[conversion] or map.numbers) } + if not p then + return -- fatal error + else + local numberdata = p.numberdata + if numberdata then + local conversionset = numberdata.conversionset + if conversionset then + local conversion = getstructureset("structure:conversions",p.block,conversionset,1,"numbers") + if conversion ~= lastconversion then + lastconversion = conversion + list[#list+1] = i - 1 -- pdf starts numbering at 0 + list[#list+1] = pdfdictionary { S = pdfconstant(map[conversion] or map.numbers) } + end end end - end - if not lastconversion then - lastconversion = "numbers" - list[#list+1] = i - 1 -- pdf starts numbering at 0 - list[#list+1] = pdfdictionary { S = pdfconstant(map.numbers) } + if not lastconversion then + lastconversion = "numbers" + list[#list+1] = i - 1 -- pdf starts numbering at 0 + list[#list+1] = pdfdictionary { S = pdfconstant(map.numbers) } + end end end lpdf.addtocatalog("PageLabels", pdfdictionary { Nums = list }) |