View Issue Details

IDProjectCategoryView StatusLast Update
0034121LazarusLCLpublic2018-08-17 05:53
ReporterDavidAssigned ToDmitry Boyarintsev 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacOSOSXOS VersionSierra
Product Version1.8.5 (SVN)Product Build 
Target VersionFixed in Version 
Summary0034121: Cocoa does not report on clipboard contents correctly.
DescriptionThe function ClipboardGetFormats() is intended to describe whats currently in the clipboard. It should return with a list if Format IDs and a Count of their number. Applications (and wrapper functions) depend on this to determine if the clipboard has content suitable to its needs.

However, line 0000254 of cocoawinapi.inc
function TCocoaWidgetSet.ClipboardGetFormats(ClipboardType: TClipboardType;
  var Count: integer; var List: PClipboardFormat): boolean;

does not alter Count and appears to put rubbish in the list.
Steps To ReproduceSee attached demo project.

It calls ClipboardGetFormats() and displays what is returned. Returns correct info under Linux and Carbon, not under Cocoa.
TagsNo tags attached.
Fixed in Revision58695
LazTarget-
WidgetsetCocoa
Attached Files

Activities

David

2018-08-12 06:14

reporter  

CocoaPaste.zip (3,170 bytes)

Dmitry Boyarintsev

2018-08-12 16:38

developer   ~0109999

please test and close, if ok

David

2018-08-13 07:17

reporter   ~0110007

No, sorry, Cocoa is not compiling now. I don't know if this problem is caused by this checkin.

cocoawscomctrls.pas(323,36) Error: method identifier expected

thats this line :
  lResult := TCocoaStatusBar.alloc.lclInitWithCreateParams(AParams);

Here is the files updated from the SVN version that did compile a few days ago -

U ide/frames/editor_markup_options.lfm
U ide/lazarusidestrconsts.pas
U lcl/dbctrls.pp
U lcl/interfaces/cocoa/cocoaprivate.pp
U lcl/interfaces/cocoa/cocoawscommon.pas
U lcl/lclstrconsts.pas
U lcl/interfaces/cocoa/cocoalclintf.inc
U lcl/interfaces/cocoa/cocoascrollers.pas
U lcl/lmessages.pp
U lcl/include/dbcombobox.inc
U lcl/include/customdbcombobox.inc
Updated to revision 58689.

My model is pull down trunk, build 32bit Lazarus and use that to build 64bit apps. I have not, recently, tried the 64bit lazarus build.

David

2018-08-13 07:18

reporter   ~0110008

see prev note

Dmitry Boyarintsev

2018-08-13 13:36

developer   ~0110013

http://wiki.freepascal.org/Cocoa_Internals#Recompilation

David

2018-08-14 05:28

reporter   ~0110024

Yeah, second time I have forgotten about that issue.
Removed .o and .ppu
However, now have issue within the function under discussion, that is ClipboardGetFormats()

cocoawinapi.inc(191,5) Error: Wrong number of parameters specified for call to "Move"

    Move(fmt[0], List^, Count * sizeof(TClipboardFormat));

My info is Move only takes 2 parameters. (and incidentally, is marked as Deprecated, not thread safe and maybe Carbon only ??). I guess we are talking about a different Move() ?

Did a fresh svn up and same situation.

Davo

Bart Broersma

2018-08-14 08:31

developer   ~0110026

System.Move() perhaps?

Dmitry Boyarintsev

2018-08-14 12:54

developer   ~0110032

you need to revert all you local changes to cocoaint.pas file

David

2018-08-16 07:38

reporter   ~0110066

Sorry, who needs to revert local changes ? Not me ...

Just pulled down changes since last discussion.

Function GetClipboardFormat() does now seem to bring back a viable list of formats. However, the function returns False.

It appears to me it returns False because CocoaWSClipboard#236 -

function TCocoaWSClipboard.GetFormats(ClipboardType: TClipboardType;
  var Count: integer; var List: TDynClipboardFormatArray): boolean;

does not set its Result if if finds valid data in Pasteboards.

Don't thinks thats right .....

Dmitry Boyarintsev

2018-08-17 01:59

developer   ~0110070

please test and close if ok

David

2018-08-17 05:53

reporter   ~0110071

Yep, thats fixed !

Tested in my little dummy test app AND tested in my big app.

Thanks Dmitry

Issue History

Date Modified Username Field Change
2018-08-12 06:14 David New Issue
2018-08-12 06:14 David File Added: CocoaPaste.zip
2018-08-12 16:38 Dmitry Boyarintsev Fixed in Revision => 58695
2018-08-12 16:38 Dmitry Boyarintsev LazTarget => -
2018-08-12 16:38 Dmitry Boyarintsev Note Added: 0109999
2018-08-12 16:38 Dmitry Boyarintsev Status new => resolved
2018-08-12 16:38 Dmitry Boyarintsev Resolution open => fixed
2018-08-12 16:38 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2018-08-13 07:17 David Note Added: 0110007
2018-08-13 07:18 David Note Added: 0110008
2018-08-13 07:18 David Status resolved => assigned
2018-08-13 07:18 David Resolution fixed => reopened
2018-08-13 13:36 Dmitry Boyarintsev Note Added: 0110013
2018-08-13 13:36 Dmitry Boyarintsev Status assigned => resolved
2018-08-13 13:36 Dmitry Boyarintsev Resolution reopened => fixed
2018-08-14 05:28 David Note Added: 0110024
2018-08-14 05:28 David Status resolved => assigned
2018-08-14 05:28 David Resolution fixed => reopened
2018-08-14 08:31 Bart Broersma Note Added: 0110026
2018-08-14 12:54 Dmitry Boyarintsev Note Added: 0110032
2018-08-14 12:54 Dmitry Boyarintsev Status assigned => resolved
2018-08-14 12:54 Dmitry Boyarintsev Resolution reopened => no change required
2018-08-16 07:38 David Note Added: 0110066
2018-08-16 07:38 David Status resolved => assigned
2018-08-16 07:38 David Resolution no change required => reopened
2018-08-17 01:59 Dmitry Boyarintsev Note Added: 0110070
2018-08-17 01:59 Dmitry Boyarintsev Status assigned => resolved
2018-08-17 01:59 Dmitry Boyarintsev Resolution reopened => fixed
2018-08-17 05:53 David Note Added: 0110071
2018-08-17 05:53 David Status resolved => closed