aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-01-24 03:22:26 +0100
committerJohannes Schickel2016-01-24 03:22:26 +0100
commit7c687a05c7e986d99f459f8efcb7bebcb53514d6 (patch)
treee58ed3abcd270a3d49e31d98bd1777aae5f0b5eb
parentc72d95cbcc81d4a9f2a51f7147e1d805c46e0d82 (diff)
downloadscummvm-rg350-7c687a05c7e986d99f459f8efcb7bebcb53514d6.tar.gz
scummvm-rg350-7c687a05c7e986d99f459f8efcb7bebcb53514d6.tar.bz2
scummvm-rg350-7c687a05c7e986d99f459f8efcb7bebcb53514d6.zip
GUI: Make PredictiveDialog::_btns a fixed size array.
-rw-r--r--gui/predictivedialog.cpp4
-rw-r--r--gui/predictivedialog.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp
index 627e6c1b96..e7766de586 100644
--- a/gui/predictivedialog.cpp
+++ b/gui/predictivedialog.cpp
@@ -70,8 +70,6 @@ enum {
PredictiveDialog::PredictiveDialog() : Dialog("Predictive") {
new StaticTextWidget(this, "Predictive.Headline", "Enter Text");
- _btns = (ButtonWidget **)calloc(16, sizeof(ButtonWidget *));
-
_btns[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd);
_btns[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , 0, kOkCmd);
_btns[kBtn1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd);
@@ -153,8 +151,6 @@ PredictiveDialog::~PredictiveDialog() {
free(_userDict.dictLine);
free(_predictiveDict.dictLine);
free(_unitedDict.dictLine);
-
- free(_btns);
}
void PredictiveDialog::reflowLayout() {
diff --git a/gui/predictivedialog.h b/gui/predictivedialog.h
index a7b7b993cc..c64fcc8264 100644
--- a/gui/predictivedialog.h
+++ b/gui/predictivedialog.h
@@ -54,6 +54,10 @@ enum ButtonId {
};
enum {
+ kButtonCount = kBtn0Act + 1
+};
+
+enum {
kRepeatDelay = 500
};
@@ -140,7 +144,7 @@ private:
bool _needRefresh;
private:
EditTextWidget *_edittext;
- ButtonWidget **_btns;
+ ButtonWidget *_btns[kButtonCount];
};
} // namespace GUI