<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 11 déc. 2019 à 21:45, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Nicolas Cellier uploaded a new version of Multilingual to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Multilingual-nice.250.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Multilingual-nice.250.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Multilingual-nice.250<br>
Author: nice<br>
Time: 11 December 2019, 9:45:47.879387 pm<br>
UUID: ebe6fac0-efa6-449b-8e4c-7eb3fd167b47<br>
Ancestors: Multilingual-mt.249<br>
<br>
Nuke keyValueIndex (my pleasure)<br>
<br>
The intention was for accessing either event buffer at 3 (macRoman) or 6 (UTF32/UCS4)<br>
<br>
Currently the choice is between 6 or 6 (it could have been dependent on VM version in 2007, but it's not and never was in Cog/Spur)<br>
<br>
Anyway, the code was testing for presence of #SugarLaunche instead of #SugarLauncher, so it would not have worked as intended (if ever we can distinguish 6 from 6).<br>
<br>
=============== Diff against Multilingual-mt.249 ===============<br>
<br>
Item was changed:<br>
  KeyboardInputInterpreter subclass: #MacUnicodeInputInterpreter<br>
+       instanceVariableNames: ''<br>
-       instanceVariableNames: 'keyValueIndex'<br>
        classVariableNames: ''<br>
        poolDictionaries: ''<br>
        category: 'Multilingual-TextConversion'!<br>
<br>
Item was changed:<br>
  ----- Method: MacUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----<br>
  nextCharFrom: sensor firstEvt: evtBuf <br>
        | keyValue mark |<br>
        keyValue := evtBuf at: 6.<br>
        mark := self japaneseSpecialMark: keyValue.<br>
        mark notNil<br>
                ifTrue: [^ mark].<br>
-       keyValue < 256<br>
-               ifTrue: [^Character value: keyValue].<br></blockquote><div><br></div><div>Ah sorry, the change above was not advertised...</div>It is because Unicode>>value: will perform the exact same test, so no need to duplicate the work!<br><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
        "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."<br>
        ^ Unicode value: keyValue!<br>
<br>
Item was changed:<br>
  KeyboardInputInterpreter subclass: #UnixUnicodeInputInterpreter<br>
+       instanceVariableNames: ''<br>
-       instanceVariableNames: 'keyValueIndex'<br>
        classVariableNames: ''<br>
        poolDictionaries: ''<br>
        category: 'Multilingual-TextConversion'!<br>
<br>
Item was removed:<br>
- ----- Method: UnixUnicodeInputInterpreter>>initialize (in category 'initialization') -----<br>
- initialize<br>
-       | satisfiesVersion launcherClass |<br>
-       launcherClass := Smalltalk at: #SugarLaunche  ifAbsent: [nil].<br>
-       satisfiesVersion := launcherClass notNil and: [launcherClass current isRunningInSugar].<br>
-       satisfiesVersion<br>
-               ifTrue: [keyValueIndex := 6]<br>
-               ifFalse: [keyValueIndex := 6  "it might have to be 3, but probably different logic to check the VM version would be better."]!<br>
<br>
Item was removed:<br>
- ----- Method: UnixUnicodeInputInterpreter>>keyValueIndex (in category 'accessing') -----<br>
- keyValueIndex<br>
-       ^ keyValueIndex!<br>
<br>
Item was changed:<br>
  ----- Method: UnixUnicodeInputInterpreter>>nextCharFrom:firstEvt: (in category 'keyboard') -----<br>
  nextCharFrom: sensor firstEvt: evtBuf <br>
        | keyValue mark |<br>
+       keyValue := evtBuf at: 6.<br>
-       keyValue := evtBuf at: self keyValueIndex.<br>
        mark := self japaneseSpecialMark: keyValue.<br>
        mark notNil<br>
                ifTrue: [^ mark].<br>
        keyValue < 256<br>
                ifTrue: [^ Character value: keyValue].<br>
        "Smalltalk systemLanguage charsetClass charFromUnicode: keyValue."<br>
        ^ Unicode value: keyValue!<br>
<br>
<br>
</blockquote></div></div>