WPCubed Product Support

Paste and OnChange

Julian,

I found that pasting text from the clopboard was not triggering the OnChange event. I made the following 2 changes to WPCTRMemo in the TWPCustomRtfEdit.PasteFromClipboard procedure:

...

finally      if Reader <> nil then      begin        Reader._DefaultImage.Free;        Reader.Free;      end;    end;    if load then                               //ZNC 09/26/2005      ChangeApplied;                           //ZNC 09/26/2005    if not TryWithImages then exit;

...

if temp.Graphic is TPersistent then
            begin
              pers := TPersistent(temp.Graphic);
              if TextObjects.NewWPObjectFromData(true, pers, wpobj, w, h) then
              begin
                wpobj.WidthTW := w;
                wpobj.HeightTW := h;
                if assigned(FBeforePasteImage) then FBeforePasteImage(Self, HeaderFooter, wpobj);
                if wpobj <> nil then
                begin
                  TextObjects.Insert(wpobj, wpobj.WidthTW, wpobj.HeightTW, '', ImageLink);
                  wpobj.Compress;
                end;
                ChangeApplied;                           //ZNC 09/26/2005
              end;
            end;

Do these changes look acceptable to you?

Thanks,
Tony

#1 ♥ 0
7k Views 3 users read 1 min
support

The first is fine, in the second case
ChangeApplied; should be after the 'Compress'.

Julian

#2 ♥ 0
support

That post is 6 years old - as far as I can see is the code in V6.

#4 ♥ 0

Sorry, I didn't notice the date.
I searched for a solution for the missing OnAfterPasteText event and stumbled on this post.
Julian has got a mail from me already about my question.

#5 ♥ 0
This category is archived. No new posts are possible.