2870 |
2870 |
2871 getListFromModel |
2871 getListFromModel |
2872 "ask my model (if any) for the text via the listMsg. |
2872 "ask my model (if any) for the text via the listMsg. |
2873 If there is no listMessage, try aspect for backward compatibility." |
2873 If there is no listMessage, try aspect for backward compatibility." |
2874 |
2874 |
2875 |newText msg| |
2875 |newText msg doCompareIfUnchanged| |
2876 |
2876 |
2877 model notNil ifTrue:[ |
2877 model notNil ifTrue:[ |
2878 msg := listMsg ? aspectMsg. |
2878 msg := listMsg ? aspectMsg. |
2879 |
2879 |
2880 msg notNil ifTrue:[ |
2880 msg notNil ifTrue:[ |
|
2881 doCompareIfUnchanged := compareModelOnUpdate. |
|
2882 |
2881 newText := model perform:msg. |
2883 newText := model perform:msg. |
2882 "/ cg: this makes many optimizations (virtualArray) useless; |
2884 "/ cg: this makes many optimizations (virtualArray) useless; |
2883 "/ I do not think that this is a good idea: |
2885 "/ I do not think that this is a good idea: |
2884 "/ text notNil ifTrue:[ |
2886 "/ text notNil ifTrue:[ |
2885 "/ so I changed it to: |
2887 "/ so I changed it to: |
2886 (newText notNil and:[newText isString]) ifTrue:[ |
2888 (newText notNil and:[newText isString]) ifTrue:[ |
2887 newText := newText asStringCollection. |
2889 newText := newText asStringCollection. |
2888 ] ifFalse:[ |
2890 ] ifFalse:[ |
2889 newText == model ifTrue:[ |
2891 newText == model ifTrue:[ |
2890 "/ I must operate on a copy |
2892 "/ I must operate on a copy |
2891 newText := model asNewOrderedCollection |
2893 newText := model asNewOrderedCollection. |
|
2894 "/ doCompareIfUnchanged := false. |
2892 ]. |
2895 ]. |
2893 ]. |
2896 ]. |
2894 |
2897 |
2895 compareModelOnUpdate ifTrue:[ |
2898 doCompareIfUnchanged ifTrue:[ |
2896 "/ see if there is a change at all. |
2899 "/ see if there is a change at all. |
2897 "/ use to compare using =, but that's not enough in case of emphasis change. |
2900 "/ use to compare using =, but that's not enough in case of emphasis change. |
2898 newText size == list size ifTrue:[ |
2901 newText size == list size ifTrue:[ |
2899 |same| |
2902 |same| |
2900 |
2903 |