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

commits at source.squeak.org commits at source.squeak.org
Fri Mar 24 17:41:18 UTC 2023


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

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

Name: System-eem.1401
Author: eem
Time: 24 March 2023, 10:41:09.838366 am
UUID: 03250e8d-202c-472e-aacc-368adbbc9c84
Ancestors: System-eem.1400

SOmetimes the WIndows ClipboardExtendedPlugin fails to add HTML data. Make ExtendedClipboardWinInterface>>clipboardText: fail-safe.

=============== Diff against System-eem.1400 ===============

Item was added:
+ ----- Method: ExtendedClipboardInterface>>primNoFailAddClipboardData:data:dataFormat: (in category 'system primitives') -----
+ primNoFailAddClipboardData: clipboard data: data dataFormat: aFormat
+ 
+ 	<primitive:'ioAddClipboardData' module: 'ClipboardExtendedPlugin' error: ec>
+ 	^ec!

Item was added:
+ ----- Method: ExtendedClipboardInterface>>tryAddClipboardData:dataFormat: (in category 'private') -----
+ tryAddClipboardData: data dataFormat: aFormat
+ 	"Attempt to add data to the clipboard in the given format.
+ 	 Answer if the attempt succeeded."
+ 	^(self primNoFailAddClipboardData: clipboard data: data dataFormat: aFormat) == self!

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:
  		[^false].
  	htmlPayload := self packageAsHTML: aText printHtmlString.
+ 	self clearClipboard.
+ 	"We don't understand why yet, but sometimes the plugin fails to copy HTML text."
+ 	^(self tryAddClipboardData: htmlPayload dataFormat: CF_HTMLTEXT)
+ 	 and: [self tryAddClipboardData: (UTF8TextConverter new encodeString: aText asString) dataFormat: CF_UTF8TEXT]!
- 	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