mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 14:59:15 +02:00
always request ownership when about to modify buffer
git-svn-id: trunk@6473 -
This commit is contained in:
parent
b632390f1e
commit
3ddfc40ef5
@ -66,6 +66,11 @@ begin
|
|||||||
Result:=FCount-1;
|
Result:=FCount-1;
|
||||||
while (Result>=0) and (FData[Result].FormatID<>FormatID) do dec(Result);
|
while (Result>=0) and (FData[Result].FormatID<>FormatID) do dec(Result);
|
||||||
if (Result<0) and CreateIfNotExists then begin
|
if (Result<0) and CreateIfNotExists then begin
|
||||||
|
if not GetOwnerShip then begin
|
||||||
|
Result:=-1;
|
||||||
|
raise Exception.Create('Unable to get clipboard ownership for '+
|
||||||
|
ClipboardTypeName[ClipboardType]);
|
||||||
|
end else begin
|
||||||
inc(FCount);
|
inc(FCount);
|
||||||
NewSize:=SizeOf(TClipboardData)*FCount;
|
NewSize:=SizeOf(TClipboardData)*FCount;
|
||||||
if FData<>nil then
|
if FData<>nil then
|
||||||
@ -76,10 +81,6 @@ begin
|
|||||||
FData[Result].FormatID:=FormatID;
|
FData[Result].FormatID:=FormatID;
|
||||||
FData[Result].Stream:=TMemoryStream.Create;
|
FData[Result].Stream:=TMemoryStream.Create;
|
||||||
FSupportedFormatsChanged:=true;
|
FSupportedFormatsChanged:=true;
|
||||||
if (not GetOwnerShip) then begin
|
|
||||||
Result:=-1;
|
|
||||||
raise Exception.Create('Unable to get clipboard ownership for '+
|
|
||||||
ClipboardTypeName[ClipboardType]);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//DebugLn('[TClipboard.IndexOfCachedFormatID] END ',ClipboardTypeName[ClipboardType]
|
//DebugLn('[TClipboard.IndexOfCachedFormatID] END ',ClipboardTypeName[ClipboardType]
|
||||||
@ -691,6 +692,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.19 2005/01/03 16:32:13 micha
|
||||||
|
always request ownership when about to modify buffer
|
||||||
|
|
||||||
Revision 1.18 2004/08/15 14:39:36 mattias
|
Revision 1.18 2004/08/15 14:39:36 mattias
|
||||||
implemented platform independent binary object streamer
|
implemented platform independent binary object streamer
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user