Fix crash when clicking the sort button in the style manager with no styles selected

Originally committed to SVN as r6628.
This commit is contained in:
Thomas Goyne 2012-03-28 23:59:10 +00:00
parent a76fb7c432
commit 31a0146df2

View file

@ -765,8 +765,11 @@ void DialogStyleManager::MoveStyles(bool storage, int type) {
int n = list->GetSelections(sels);
if (n == 0 && type != 4) return;
int first = sels.front();
int last = sels.back();
int first = 0, last = 0;
if (n) {
first = sels.front();
last = sels.back();
}
if (storage) {
do_move(Store, type, first, last, true);