mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdeui: fix crash in case the font has no styles
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
793122d444
commit
274ef92d4e
1 changed files with 11 additions and 9 deletions
|
@ -652,7 +652,9 @@ void KFontChooser::Private::_k_family_chosen_slot(const QString& family)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
styleListBox->setCurrentRow(listPos >= 0 ? listPos : 0);
|
styleListBox->setCurrentRow(listPos >= 0 ? listPos : 0);
|
||||||
QString currentStyle = qtStyles[styleListBox->currentItem()->text()];
|
QListWidgetItem* currentitem = styleListBox->currentItem();
|
||||||
|
if (currentitem) {
|
||||||
|
QString currentStyle = qtStyles[currentitem->text()];
|
||||||
|
|
||||||
// Recompute the size listbox for this family/style.
|
// Recompute the size listbox for this family/style.
|
||||||
qreal currentSize = setupSizeListBox(currentFamily, currentStyle);
|
qreal currentSize = setupSizeListBox(currentFamily, currentStyle);
|
||||||
|
@ -663,7 +665,7 @@ void KFontChooser::Private::_k_family_chosen_slot(const QString& family)
|
||||||
selFont.setPointSizeF(currentSize);
|
selFont.setPointSizeF(currentSize);
|
||||||
}
|
}
|
||||||
emit q->fontSelected(selFont);
|
emit q->fontSelected(selFont);
|
||||||
|
}
|
||||||
signalsAllowed = true;
|
signalsAllowed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue