anchor.diff:  
     if Sx*Sy <> 0 then
     begin
  -    {$IFDEF MSWindows}
  +    {$IFDEF WDC}
       hMem := GlobalAlloc(GMEM_DDESHARE or GMEM_MOVEABLE, BufferStream.Size);
       BufPtr := GlobalLock(hMem);
       Move(BufferStream.Memory^, BufPtr^, BufferStream.Size);
       Clipboard.SetAsHandle(CF_MAPDATA, hMem);
       GlobalUnlock(hMem);
       {$ENDIF}
  +    {$IFDEF FPC}
  +    Clipboard.SetFormat(CF_MAPDATA, BufferStream);
  +    {$ENDIF}
     end;
     BufferStream.Free;
   end;
  
positive.code:   BufPtr: Pointer;
    BufferStream: TKMemoryStream;
  begin
    {$IFDEF MSWindows}
    hMem := Clipboard.GetAsHandle(CF_MAPDATA);
    if hMem = 0 then Exit;
    BufPtr := GlobalLock(hMem);
    if BufPtr = nil then Exit;
    BufferStream := TKMemoryStream.Create;
    BufferStream.WriteBuffer(BufPtr^, GlobalSize(hMem));
    BufferStream.Position := 0;
    BufferStream.Read(Sx);
    BufferStream.Read(Sy);
  
negative.code:   for I:=0 to Sy-1 do
      for K:=0 to Sx-1 do
        BufferStream.Read(fSelectionBuffer[I,K], SizeOf(fSelectionBuffer[I,K]));
    BufferStream.Free;
  
  
    //Mapmaker could have changed selection rect, sync it with Buffer size
  