DeleteTrailingSpace deletes new page

  • If the last paragraph is set to start a new page, DeleteTrailingSpace will delete that paragraph. This is not good since I am appending multiple WPRichTexts to each other, trimming blank lines between them, but the customer may have manually added a page break to make sure the 2nd one starts on a new page.

    To fix this, I added to the conditional in DeleteTrailingSpace in WPCTRMeno:

    Code
    if (par.ParagraphType = wpIsSTDPar) and
          (not (paprNewPage in par.prop)) and
          (not par.IsNonSpace([wpobjMergeField])) then

    I added the paprNewPage check. which fixes the issue.

    Food for thought. Haven't looked to see if WPTools7 has this issue or not yet, but if it does perhaps you can provide this as an option? (I am still in the process of porting my app over to XE6 and WPTools7 from D2007 and WPTools5).