Beiträge von phb

    Hi.

    Recently the "wpcoDontCopyProtectedAttribute" was added to prevent copying protected text.

    I rather like an "wpcoDontPasteProtectedAttribute". Do you plan to make such or can I prevent pasting protected text in another way.

    Maybe a solution where all contents of clipboard is pasted just without the protected indicator/codes.

    The following code describes my problem:

    Code
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      WPRichText1.ProtectedProp := [];
      WPRichText1.CurrAttr.AddStyle([afsProtected]);
      WPRichText1.InputString(#13);
      WPRichText1.InputString('Test');
      WPRichText1.InputString(#13);
      WPRichText1.CurrAttr.DeleteStyle([afsProtected]);
      WPRichText1.ProtectedProp := [ppParProtected,ppProtected];
    end;

    It is possible to insert text before 'Test', and the text inserted gets protected so it can't be removed again. Isn't this somehow a bug.
    Isn't it possible to make the CR protected too?

    Hi,

    I have a lot of methods that uses InputString/InputStringW to insert text into TWPRichText.

    In most of these methods CP moves to another place in the document, then it inserts the text, and then finally CP jumps back to where it came from.

    The probem is that the text inserted is inserted with the font where the CP origionally came from. I just want to use the font attributes used where it is inserted.

    I have tried to use WritingAttr and CurrentCharAttr but haven't succeced. Can someone please help me.

    Hi

    Im trying to implement a method that can merge the bodypart of a document (stored in the filesystem) at the end of an existing document. The existing document can be with/without header/footers information, but at all time only bodypart should be merged. I made the following methods but even though the merge-memorystream contains data, it doesn't seem to get inserted. What Im I doing wrong, or should I do it in another way?

    FYI, the document are .rtf poss. with unicode text.

    It doesn't matter wheater I switch order in SelectMarker. I still doesn't work. I use the wrong order because it is that way you wrote it in one of your examples :wink:

    Even if "// do something" is nothing like the code i send you it still doesn't work. So maybe there is some kind of bug in WPTools or maybe I have a bug in my code. Can you tell?

    Hi

    I am trying to remember cp position and possible text selection. CP position works fine using markers functionality, but I cant seem to get the selection to work. Is it a bug or am I doing something wrong?

    Code should be almost the same as you described in the WPTools5Upgrade.pdf

    Im using WPTOOLS [5.19], Delphi 2005

    Hi.

    ppDontUseAttrOfProtected, did the job. I could not find out what it did by looking in the manual. Only using ppIsBookmark and not use afsProtected wont protect the text inside the bookmark. Or is there something I have missed.

    By the way would it be possible to show start and end markers of protected text just like you can do with bookmarks. Maybe by using 'wpobjTextProtection' somewhere?

    Hi

    Im having some troubles converting my "protected text" functionality to WPTools5. Please take a look at the following code. This should simplify my problem. The code inserts a bookmark and write som text inside the bookmark. Everything include the bookmark markers are inserted as protected Text. This worked back in v4.x but in 5.x this will result in text added before or after the bookmark (protected) will also be protected:(

    FYI, my ProtectedProp := [ppProtected,ppIsBookmark,ppAllowEditAtTextEnd,ppProtectSelectedTextToo]

    If I swap the lines marked with // 1 and // 2 everything works fine but that is regarding to the new ppIsBookmark protected. All my old documents made with v. 4.x all have the bookmark inserted as protected text, so I need to handle this to.

    Any Ideas of what I can do? Is it a bug that v. 5.x cant handle it?

    Hi

    I finally got it to work. I'll post the code here, and maybee other could benefit from it. The only thing left is that when nothing i selected everything is returned by the SaveSelectionToStream. I would say that this is inappropriate. Wouldn't you agree?

    Hi,

    I tried the SaveToStream(aStream, 'UNICODE', true) but...

    ...It returns all text and not only selection. Maybee it has something to do with the third boolean parameter, which is not present in my version [5.19]. Should this have been an SelectionOnly boolean?

    Additional I have really hard times getting the stream converted to a WideString. Maybe you already have an example of how it can be done, knowing that this is really not an WPTools issue :D

    Hi,

    I think there might be a little bug in the BookmarkAtCP method

    I use code like this to determine if im inside at bookmark

    Code
    // check if inside bookmark
    objText := rteEditor.BookmarkAtCP;
    Result := Assigned(objText);

    But when CP is after the last char in the bookmark (or inside an emty bookmark) method BookmarkAtCP returns nil.

    WPTools[V5.18.9]