From 4fbb944f132eb886a6f5b350e5a14a4fe380aacf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Jul 2015 00:12:09 +0300 Subject: Add missing checks into gui. --- src/gui/windows/textdialog.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/gui/windows/textdialog.cpp') diff --git a/src/gui/windows/textdialog.cpp b/src/gui/windows/textdialog.cpp index 642d574cc..0d74c95e5 100644 --- a/src/gui/windows/textdialog.cpp +++ b/src/gui/windows/textdialog.cpp @@ -68,18 +68,10 @@ TextDialog::TextDialog(const std::string &restrict title, place(2, 2, mOkButton); place(3, 2, cancelButton); - const Font *const font = getFont(); - if (font) - { - int width = font->getWidth(title); - if (width < textLabel->getWidth()) - width = textLabel->getWidth(); - reflowLayout(static_cast(width + 20)); - } - else - { - reflowLayout(static_cast(textLabel->getWidth() + 20)); - } + int width = getFont()->getWidth(title); + if (width < textLabel->getWidth()) + width = textLabel->getWidth(); + reflowLayout(static_cast(width + 20)); } void TextDialog::postInit() -- cgit v1.2.3-70-g09d2