Skip to content

Commit

Permalink
Use identity comparisons when looking for elements in a list.
Browse files Browse the repository at this point in the history
This fixes pharo-vcs/iceberg#1831, which fails to update the drop down list because objects are wrapped in SpDropListItem that are badly configured.
  • Loading branch information
guillep committed Jul 4, 2024
1 parent 2be6762 commit 3967790
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/Spec2-Core/SpAbstractSelectionMode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ SpAbstractSelectionMode >> includesItem: anItem [

{ #category : 'private' }
SpAbstractSelectionMode >> indexOfItem: anItem [

^ self model
indexOf: anItem
ifAbsent: [ 0 ].

^ self model indexOf: anItem ifAbsent: 0
]

{ #category : 'initialization' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpCollectionListModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SpCollectionListModel >> hasElementAt: index [
{ #category : 'accessing' }
SpCollectionListModel >> indexOf: anIndex ifAbsent: aBlock [

^ collection indexOf: anIndex ifAbsent: aBlock
^ collection identityIndexOf: anIndex ifAbsent: aBlock
]

{ #category : 'initialization' }
Expand Down
6 changes: 3 additions & 3 deletions src/Spec2-Core/SpStringTableColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ SpStringTableColumn >> onAcceptEdition: aBlock [
acceptAction := aBlock
]

{ #category : #api }
{ #category : 'api' }
SpStringTableColumn >> onTextChanged: aBlock [
"Set the block to execute when cell edition is edited.
`aBlock` receives two arguments:
Expand All @@ -135,7 +135,7 @@ SpStringTableColumn >> onTextChanged: aBlock [
textChanged := aBlock
]

{ #category : #api }
{ #category : 'api' }
SpStringTableColumn >> sortFunction [

^ super sortFunction ifNil: [ self evaluation ascending ]
Expand All @@ -156,7 +156,7 @@ SpStringTableColumn >> sortFunction: aBlockOrSortFunction [
self isSortable: aBlockOrSortFunction isNotNil
]

{ #category : #accessing }
{ #category : 'accessing' }
SpStringTableColumn >> textChanged [

^ textChanged
Expand Down

0 comments on commit 3967790

Please sign in to comment.