feat: a section numbers its pages in its own format

A roman front matter before a decimal body is one page style before another
in ODF and one w:pgNumType per section in Word, not a document setting — read
as one, its pages printed 1, 3 where the reference prints i, iii. HfSet grows
pageNumberFormat, both exports write it back, and the DOCX importer takes the
document's own format from the first section, as it already does the paper.
This commit is contained in:
Steffen Becker committed 2026-09-04 19:30:05 +02:00
1 parent ad12231bf0
commit 862ba22df2
8 files changed
+66 -14

No files matched your search

+2 -2
View File
@@ -378,8 +378,8 @@ export class StyleResolver {
// The page-number format, from the page layout of the governing master page.
// ODF's own default is decimal, which is `1` here.
pageNumberFormat(): NoteNumFormat {
const props = this.pageLayoutEl()?.getElementsByTagNameNS(NS.style, 'page-layout-properties')[0] ?? null;
pageNumberFormat(pageName: string | null = null): NoteNumFormat {
const props = this.pageLayoutEl(pageName)?.getElementsByTagNameNS(NS.style, 'page-layout-properties')[0] ?? null;
const f = props?.getAttributeNS(NS.style, 'num-format') ?? '';
return (['1', 'i', 'I', 'a', 'A'] as const).includes(f as NoteNumFormat) ? (f as NoteNumFormat) : '1';
}