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
1 changed files with 5 additions and 2 deletions

View File

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