WPTools5 upgrade question: parIsProtected

  • Hi!

    I am now in the process of upgrading WPTools4 to WPTools5 and WPForm 2.30 to WPForm 2.50.

    Much has been changed I must say but I have been able to find fixes for most.

    I am however in doubt how to fix the following code:

    var par: PTParagraph;
    begin
    par := self.ActivePar;
    while (par<>nil) do
    begin
    Include(par^.Prop, parIsProtected);
    par := par^.Next;
    end;
    end;

    Can someone help me here?

    Regards,
    Erik

  • Hi Eric

    I don't know exactly what you want. What I could understand is that you need to protect a piece of text. Well, I had to do this also, and used two different approachs:

    1. Apply the style directly: It will protect the selected text

    Code
    procedure ProtectIt(poWPRichText: TWPRichText);begin  poWPRichText.CurrAttr.AddStyle([afsProtected]);end;

    2. Using AttrHelper: It UN-protects anything, not just selected text


    You may take a look at the WPTools5Upgrade.pdf file for more information about AttrHelper. It should accomplish your needs.

    Hope this helps.

    Alessandro Fragnani