summaryrefslogtreecommitdiff
path: root/src/gui/windows/textdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:09 +0300
commit4fbb944f132eb886a6f5b350e5a14a4fe380aacf (patch)
tree6df2ed96430610ee7c35a7ca4902bbdade0e8e34 /src/gui/windows/textdialog.cpp
parent1dc012a3bb44218778568e8f80c4e9b445802195 (diff)
downloadmv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.gz
mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.bz2
mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.tar.xz
mv-4fbb944f132eb886a6f5b350e5a14a4fe380aacf.zip
Add missing checks into gui.
Diffstat (limited to 'src/gui/windows/textdialog.cpp')
-rw-r--r--src/gui/windows/textdialog.cpp16
1 files changed, 4 insertions, 12 deletions
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<int>(width + 20));
- }
- else
- {
- reflowLayout(static_cast<int>(textLabel->getWidth() + 20));
- }
+ int width = getFont()->getWidth(title);
+ if (width < textLabel->getWidth())
+ width = textLabel->getWidth();
+ reflowLayout(static_cast<int>(width + 20));
}
void TextDialog::postInit()