Răsfoiți Sursa

* text/plain for normal text type

Michaël Van Canneyt 5 luni în urmă
părinte
comite
345376de9f
1 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 7 7
      src/base/fresnel.clipboard.pp

+ 7 - 7
src/base/fresnel.clipboard.pp

@@ -33,13 +33,13 @@ Type
     Class Property Instance : TFresnelClipBoard Read GetInstance;
   Public
     Function GetContentTypes : TStringDynArray;
-    // aMimetype is "text/text" or "text", in which case it is assumed to be the first part.
+    // aMimetype is "text/plain" or "text", in which case it is assumed to be the first part.
     Function HasType(const aMimeType : string) : boolean;
     // Get clipboard data. aMimetype has the same form as HasType. Returns the exact type.
     // For example Get
     function GetAsType(const aMimeType : string; out aContents : TBytes) : string;
     procedure SetAsType(const aMimeType : string; aContents : TBytes);
-    function HasText(strict : boolean) : Boolean;
+    function HasText(strict : boolean = True) : Boolean;
     Property AsText : String Read GetAsText Write SetAsText;
   end;
   TFLClipBoard = TFresnelClipBoard;
@@ -64,7 +64,7 @@ var
   lContent : TBytes;
 
 begin
-  if DoGetClipboardAsType('text',lContent)<>'' then
+  if DoGetClipboardAsType('text/plain',lContent)<>'' then
     Result:=TEncoding.UTF8.GetAnsiString(lContent)
   else
     Result:='';
@@ -91,13 +91,13 @@ var
   lContent : TBytes;
 begin
   lContent:=TEncoding.UTF8.GetAnsiBytes(aValue);
-  DoSetClipboardAsType('text/text',lContent);
+  DoSetClipboardAsType('text/plain',lContent);
 end;
 
 function TFresnelClipBoard.GetContentTypes: TStringDynArray;
 begin
   Result:=[];
-  DoGetContentTypes;
+  Result:=DoGetContentTypes;
 end;
 
 function TFresnelClipBoard.HasType(const aMimeType: string): boolean;
@@ -115,10 +115,10 @@ begin
   DoSetClipboardAsType(aMimeType,aContents);
 end;
 
-function TFresnelClipBoard.HasText(strict: boolean): Boolean;
+function TFresnelClipBoard.HasText(strict: boolean = True): Boolean;
 begin
   if Strict then
-    Result:=DoHasClipboardType('text/text')
+    Result:=DoHasClipboardType('text/plain')
   else
     Result:=DoHasClipboardType('text')
 end;