1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made the copy constuctor of SelectedItemSet call its virtual itemSelected/itemDeselected methods.

This commit is contained in:
jules 2015-08-17 11:50:46 +01:00
parent 5b6eef15a4
commit 07afa76759

View file

@ -71,8 +71,20 @@ public:
{
if (selectedItems != other.selectedItems)
{
selectedItems = other.selectedItems;
changed();
for (int i = selectedItems.size(); --i >= 0;)
if (! other.isSelected (selectedItems.getReference (i)))
itemDeselected (selectedItems.remove (i));
for (SelectableItemType* i = other.selectedItems.begin(), *e = other.selectedItems.begin(); i != e; ++i)
{
if (! isSelected (*i))
{
selectedItems.add (*i);
itemSelected (*i);
}
}
}
return *this;
@ -101,8 +113,8 @@ public:
}
else
{
deselectAll();
changed();
deselectAll();
selectedItems.add (item);
itemSelected (item);