Page 1 of 1

Should Paragraph Style "Normal" Be Based On "DocDefaults"

PostPosted: Wed Nov 18, 2015 11:51 pm
by wbansa
StyleDefinitionsPart.createVirtualStylesForDocDefaults() called from PropertyResolver.init() creates a paragraph style "DocDefaults" from the document defaults in the styles part and makes the default paragraph style ("Normal" in English but ..) based on this style.

When evaluating the style hierarchy from ECMA 376 Part 4 ยง2.7.2 the following happens:
  • The document defaults are applied -- ok
  • Table styles are applied (extension of mine to PropertyResolver). This may override the defaults -- ok
  • Numbering styles are ignored -- ok
  • Paragraph styles are applied. Most paragraph styles inherit from "Normal", "Normal" inherits from "DocDefaults". So this will reapply the document defaults overridden by the table styles -- NOT ok
My arguments are:
  • "Normal" must not be based on document defaults.
  • A class with the javadoc description
    This class works out the actual set of properties (paragraph or run) which apply, following the order specified in ECMA-376.
    must not trigger permanent changes to the underlying StylesDefinitionPart.
Looking forward to Jason's comments.
Wolfgang

(From the Contact form I understood that this type of discussion should got into the forum. Is this ok?)

Re: Should Paragraph Style "Normal" Be Based On "DocDefaults

PostPosted: Thu Nov 19, 2015 7:11 am
by jason
Agreed; we're planning to stop doing this in v3.3

In practice, regarding table styles:

* w:compatSetting[w:name="overrideTableStyleFontSizeAndJustification"]
* is defined in [MS-DOCX]
*
* If this value is true, then the style hierarchy of the document is evaluated as specified
* in [ISO/IEC29500-1:2011] section 17.7.2.
*
If this value is false, which is the default, then the following additional rules apply:

If the default paragraph style (as specified in [ISO/IEC29500-1:2011] section 17.7.4.17)
specifies a font size of 11pt or 12pt, then that setting will not override the font size
specified by the table style for paragraphs in tables.

If the default paragraph style (as specified in [ISO/IEC29500-1:2011] section 17.7.4.17)
specifies a justification of left, then that setting will not override the justification
specified by the table style for paragraphs in tables.