2.4.6.1 Direct Paragraph Formatting

This section explains how to find the properties applied directly (as opposed to through a style, for example) to a paragraph, given a character position cp within it. The properties are found as an array of Prl elements.

  1. Follow the algorithm from Determining Paragraph Boundaries for finding the character position of the last character in the paragraph to completion. From step 5, remember the PapxFkp and k. From step 4, remember the offset in the WordDocument Stream at which PapxFkp was read. Let this offset be called of. From step 2 remember the Pcd. If the algorithm from Determining Paragraph Boundaries specifies that cp is invalid, leave the algorithm.

  2. Find a BxPap at PapxFkp.rgbx[k]. Find a PapxInFkp at offset of + 2*BxPap.bOffset

  3. Find a GrpprlAndIstd in the PapxInFkp from step 2. The offset and size of the GrpprlAndIstd is instructed by the first byte of the PapxInFkp, as detailed at PapxInFkp.

  4. Find the grpprl within the GrpprlAndIstd. This is an array of Prl elements that specifies the direct properties of this paragraph.

  5. Finally Pcd.Prm specifies further property modifications that apply to this paragraph. If Pcd.Prm is a Prm0 and the Sprm specified within Prm0 modifies a paragraph property, append to the array of Prl elements from the previous step a single Prl made of the Sprm and value in Prm0. if Pcd.Prm is a Prm1, append to the array of Prl elements from the previous step any Sprm structures that modify paragraph properties within the array of Prl elements specified by Prm1.