From f16330e8d7f0e15d79b17a162a77044da57bb748 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 30 Sep 2009 10:22:29 +0200 Subject: Fix tst_QFontDialog::task256466_wrongStyle() autotest failure in Cocoa. Some fonts contain only styles other than Normal (or Regualr). If we try to retrive the font sizes for such fonts by passing an empty style string, the QFontDatabase will return a null list. This was causing the autotest to fail. This patch will make sure that a style is always selected in the QFontDialog. Reviewed-by: Olivier --- src/gui/dialogs/qfontdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index ca882c5..60fae27 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -602,6 +602,8 @@ void QFontDialogPrivate::updateStyles() } if (!found) styleList->setCurrentItem(0); + } else { + styleList->setCurrentItem(0); } styleEdit->setText(styleList->currentText()); -- cgit v0.12