[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9ec7d83 2/7: Update item selection of wxItemC
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9ec7d83 2/7: Update item selection of wxItemContainer only when necessary |
Date: |
Thu, 13 Jun 2019 20:39:00 -0400 (EDT) |
branch: master
commit 9ec7d83f525bf3e230897b3ecc8826f133633577
Author: Ilya Sinitsyn <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Update item selection of wxItemContainer only when necessary
wxItemContainer::SetStringSelection function is slower then
wxItemContainer::GetStringSelection, so update the selected item only
when the selection was really changed.
---
mvc_controller.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mvc_controller.cpp b/mvc_controller.cpp
index 60329a8..77eb54b 100644
--- a/mvc_controller.cpp
+++ b/mvc_controller.cpp
@@ -353,7 +353,11 @@ void MvcController::ConditionallyEnableItems
itembox->Set(cached_items);
}
- itembox->SetStringSelection(datum->str(datum->ordinal()));
+ auto const& selected_string = datum->str(datum->ordinal());
+ if(itembox->GetStringSelection() != selected_string)
+ {
+ itembox->SetStringSelection(selected_string);
+ }
}
else
{
- [lmi-commits] [lmi] master updated (e861045 -> 5fce601), Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master 5fce601 7/7: Correct a typo, Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master 92bc792 6/7: Add a 'MinPremType' database entity, Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master f59aa3a 5/7: Add some useful commands, Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master a729e1a 4/7: Regularize argument order, Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master 7bc7a7b 3/7: Include standard header for std::swap(), Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master 362d02d 1/7: Cache items of wxItemContainer in MvcController, Greg Chicares, 2019/06/13
- [lmi-commits] [lmi] master 9ec7d83 2/7: Update item selection of wxItemContainer only when necessary,
Greg Chicares <=