From 048dcb82c45332429eb58b85b9a2f3e240aa8e72 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 26 Feb 2010 09:12:54 +0000 Subject: [PATCH] synedit: Paste: first check for synedit format then request it git-svn-id: trunk@23795 - --- components/synedit/syneditmiscclasses.pp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/synedit/syneditmiscclasses.pp b/components/synedit/syneditmiscclasses.pp index 9d04e10388..699a348ac6 100644 --- a/components/synedit/syneditmiscclasses.pp +++ b/components/synedit/syneditmiscclasses.pp @@ -852,20 +852,25 @@ var ip: PInteger; len: LongInt; begin + Result := false; Clear; - Result := AClipboard.GetFormat(ClipboardFormatId, FMemStream); + FTextP := nil; // Check for embedded text - FTextP := GetTagPointer(synClipTagText); - if FTextP <> nil then begin - len := GetTagLen(synClipTagText); - if len > 0 then - (FTextP + len - 1)^ := #0 - else - FTextP := nil; + if AClipboard.HasFormat(ClipboardFormatId) then begin + Result := AClipboard.GetFormat(ClipboardFormatId, FMemStream); + FTextP := GetTagPointer(synClipTagText); + if FTextP <> nil then begin + len := GetTagLen(synClipTagText); + if len > 0 then + (FTextP + len - 1)^ := #0 + else + FTextP := nil; + end; end; // Normal text if (FTextP = nil) and AClipboard.HasFormat(CF_TEXT) then begin - FText:= AClipboard.AsText; + Result := true; + FText := AClipboard.AsText; if FText <> '' then begin FTextP := @FText[1]; ip := GetTagPointer(synClipTagExtText);