ClearTextInbetween + single paragraph + wpNoDeletePar

  • WPTools version 6.13

    Assume:
    - ppProtectSelectedTextToo on
    - Paragraph with TWPProtectedMode << wpNoDeletePar

    If I select some text _within_ the paragraph above and press Delete, the text is not deleted. Shouldn't TWPRTFDataCursor.ClearTextInbetween only check for wpNoDeletePar if a paragraph actually is going to be deleted (basically par_s != par_e)?


    Regards
    patrik.nyborg(a)genicore.se

    • Offizieller Beitrag
    Zitat

    If I select some text _within_ the paragraph above and press Delete, the text is not deleted. Shouldn't TWPRTFDataCursor.ClearTextInbetween only check for wpNoDeletePar if a paragraph actually is going to be deleted (basically par_s != par_e)?

    I cannot reproduce. I tried

    WPRichText1.ActiveParagraph.ASet(WPAT_ParProtected, 1);
    WPRichText1.ProtectedProp := [ppParProtected,ppProtectSelectedTextToo];

    to protect one paragraph.

    But, if you select text from one paragraph to the next, the deletion operation would remove the next paragraph and append the rest of the text in the delete paragraph to the one before. It actually deletes the second paragraph. Then it is correct not to perform the operation.

    Julian

  • Basically what I'm suggesting is something like this:


    Regards
    patrik.nyborg(a)genicore.se

  • First: This has _nothing_ to do with nested paragraphs.
    Second: I guess I could start patching more aggresivly. But if I interpret you correctly (optimized=works correctly for) subparagraph handling is poor which will require modifications all over the place. Adding the fact that it's really hard to debug (I have to move the methods of interest to the beginning of WPRteDefs.pas to be able to set a breakpoint - http://wpcubed.com/forum/viewtopi…d24788fd11fd305), this feels like the beginning of the end.


    patrik.nyborg(a)genicore.se