metanorma-iso 3.5.43 → 3.5.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/docx/toc_builder.rb +17 -12
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85160d800ea91d670e92a2e1a29ae26cba19eb81033e61e9b8bef7a719c83557
|
|
4
|
+
data.tar.gz: be24fbed96e6dab380ccf71eef464b0f4c2a76574ce0d49e6308ed99d4801773
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d409e6a448a0339b12d1ec1bcfbfda95dbbc815d7551f72893e4b815b0a0cd2411b61d98e3b7e963d054e866ab9e9f2f8b5d8b6f7946bd8b51dcabdd989f9d26
|
|
7
|
+
data.tar.gz: 222dcec902710e79cf9cf51ad182f3ba361f9b437e446f92357fd230ab11104cec1e90e3aa1bcf7bd6709f8657da41f6475a5bb0e5e0fedbdcd5f2885d9a76f7
|
|
@@ -75,18 +75,22 @@ module IsoDoc
|
|
|
75
75
|
close_field: index == entries.size - 1)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
# No w:updateFields flag in word/settings.xml (owner ruling).
|
|
79
|
+
# The flag used to be set here so Word recomputed the ToC on
|
|
80
|
+
# open, but Word auto-evaluates PAGEREF fields during its
|
|
81
|
+
# on-open pagination with or without the flag, so the flag
|
|
82
|
+
# bought nothing except the "This document contains fields
|
|
83
|
+
# that may refer to other files" prompt on every open. The
|
|
84
|
+
# cached page numbers remain placeholders — the documented
|
|
85
|
+
# tradeoff for DOCX-only compiles, where no pagination data
|
|
86
|
+
# exists until a layout engine runs. When the PDF leg is
|
|
87
|
+
# requested, a future enhancement may bake the harvested
|
|
88
|
+
# numbers into the cached results, but the mechanism must
|
|
89
|
+
# never depend on it.
|
|
79
90
|
end
|
|
80
91
|
|
|
81
92
|
private
|
|
82
93
|
|
|
83
|
-
# The cached page numbers are placeholders; w:updateFields makes
|
|
84
|
-
# Word recompute them (and the TOC) when the document is opened.
|
|
85
|
-
def request_field_refresh(doc)
|
|
86
|
-
doc.model.settings ||= Uniword::Wordprocessingml::Settings.new
|
|
87
|
-
doc.model.settings.update_fields = Uniword::Wordprocessingml::UpdateFields.new
|
|
88
|
-
end
|
|
89
|
-
|
|
90
94
|
def render_toc_heading(model, doc)
|
|
91
95
|
para = Uniword::Builder::ParagraphBuilder.new
|
|
92
96
|
para.style = @resolver.paragraph_style(:contents_title)
|
|
@@ -311,10 +315,11 @@ module IsoDoc
|
|
|
311
315
|
render_toc_heading_text(entry.source, runs)
|
|
312
316
|
append_tab(runs)
|
|
313
317
|
|
|
314
|
-
# PAGEREF field with a placeholder result: the static result
|
|
315
|
-
#
|
|
316
|
-
#
|
|
317
|
-
#
|
|
318
|
+
# PAGEREF field with a placeholder result: the static result is
|
|
319
|
+
# "1" until Word refreshes the field. Word auto-evaluates
|
|
320
|
+
# PAGEREF during its on-open pagination (no w:updateFields
|
|
321
|
+
# flag is set — see render for the ruling), so the entry's
|
|
322
|
+
# bookmark yields the real page number on open.
|
|
318
323
|
runs << field_char_run("begin")
|
|
319
324
|
runs << instr_text_run(" PAGEREF #{entry.bookmark_name} \\h ")
|
|
320
325
|
runs << field_char_run("separate")
|