Minor error in TWPRTFEnginePaint.PaintRTFPage/PaintLine

  • Just stumbled on a minor error in TWPRTFEnginePaint.PaintRTFPage/PaintLine

    It can be reproduced in WPToolsDemo.exe with this rtf-document.

    TestBericht.rtf

    If you select the text "Röntgen: " including the space after the colon and then delete it with DEL or backspace, a range-check-error is thrown on line 7547

    Code
    rw := rw + lineData.Par.CharPos[pobj_i].xoff;

    lineData.Par.CharCount is 0 and the CharPos-array is empty.

    Adding an additional check for CharCount > 0 did it, so no impediment for me.


    Using version 9.1.004