[squeak-dev] The Trunk: System-eem.1400.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 24 17:32:16 UTC 2023


Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1400.mcz

==================== Summary ====================

Name: System-eem.1400
Author: eem
Time: 24 March 2023, 10:32:09.838089 am
UUID: ebd792de-14b8-42e5-8443-aca3d03c4a4d
Ancestors: System-eem.1399

Oops! ExtendedClipboard[Mac|Win]Interface>>clipboardText: must clear the clipboard before pasting text!!

=============== Diff against System-eem.1399 ===============

Item was changed:
  ----- Method: ExtendedClipboardMacInterface>>clipboardText: (in category 'general-api-add') -----
  clipboardText: aText
  	"Attempt to paste aText to the system clipboard in as many formats as makes sense on the platform.
  	 Answer if the attempt succeeded.  On the Mac we paste HTML and UTF8. But we can only paste more
  	 than one thing at a time with the VMMaker.oscog-eem.3276 version of the plugin, or later."
  	| htmlPayload |
  	(aText isText
+ 	 and: [clipboard ~= 0
+ 	 and: [self class pluginVersion >= 3276]]) ifFalse:
- 	 and: [self class pluginVersion >= 3276]) ifFalse:
  		[^false].
  	htmlPayload := String streamContents:
  						[:stream |
  						stream nextPutAll: '<meta charset="UTF-8">'.
  						aText printHtmlOn: stream].
  	self
+ 		clearClipboard;
  		addClipboardData: htmlPayload dataFormat: 'public.html';
  		addClipboardData: (UTF8TextConverter new encodeString: aText asString) dataFormat: 'public.utf8-plain-text'.
  	^true!

Item was changed:
  ----- Method: ExtendedClipboardWinInterface>>clipboardText: (in category 'private') -----
  clipboardText: aText
  	"Attempt to paste aText to the system clipboard in as many formats as makes sense on the platform.
  	 Answer if the attempt succeeded.  On Windows we paste HTML and UTF8. But we can only paste more
  	 than one thing at a time with the VMMaker.oscog-eem.3276 version of the plugin, or later.  Note that
  	 the funky HTML format (see packageAsHTML:) has been derived by observing Chrome and Edge."
  	| htmlPayload |
  	(aText isText
+ 	 and: [clipboard ~= 0
+ 	 and: [self class pluginVersion >= 3276]]) ifFalse:
- 	 and: [self class pluginVersion >= 3276]) ifFalse:
  		[^false].
  	htmlPayload := self packageAsHTML: aText printHtmlString.
  	self
+ 		clearClipboard;
  		addClipboardData: htmlPayload dataFormat: CF_HTMLTEXT;
  		addClipboardData: (UTF8TextConverter new encodeString: aText asString) dataFormat: CF_UTF8TEXT.
  	^true!



More information about the Squeak-dev mailing list