summaryrefslogtreecommitdiff
path: root/src/spellshortcut.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-24 14:03:12 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-24 14:03:12 +0300
commit17f5fe7521ea045b3ce4bffda708b813359c5ee0 (patch)
tree74355a6f8c209a92eb950d6127987f42e990d725 /src/spellshortcut.cpp
parentf1f5595df167c69cc1c04157e477cd9dce290f66 (diff)
downloadplus-17f5fe7521ea045b3ce4bffda708b813359c5ee0.tar.gz
plus-17f5fe7521ea045b3ce4bffda708b813359c5ee0.tar.bz2
plus-17f5fe7521ea045b3ce4bffda708b813359c5ee0.tar.xz
plus-17f5fe7521ea045b3ce4bffda708b813359c5ee0.zip
improve spellshortcut class.
Diffstat (limited to 'src/spellshortcut.cpp')
-rw-r--r--src/spellshortcut.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/spellshortcut.cpp b/src/spellshortcut.cpp
index 533e071a5..5a3dd6eda 100644
--- a/src/spellshortcut.cpp
+++ b/src/spellshortcut.cpp
@@ -48,18 +48,17 @@ SpellShortcut::~SpellShortcut()
void SpellShortcut::load()
{
- for (unsigned f = 0; f < SPELL_SHORTCUT_ITEMS * SPELL_SHORTCUT_TABS; f ++)
+ for (unsigned f = 0; f < SPELLS_SIZE; f ++)
mItems[f] = -1;
if (!spellManager)
return;
- std::vector<TextCommand*> spells = spellManager->getAll();
+ const std::vector<TextCommand*> spells = spellManager->getAll();
unsigned k = 0;
for (std::vector<TextCommand*>::const_iterator i = spells.begin(),
- i_end = spells.end(); i != i_end
- && k < SPELL_SHORTCUT_ITEMS * SPELL_SHORTCUT_TABS; ++i)
+ i_end = spells.end(); i != i_end && k < SPELLS_SIZE; ++i)
{
mItems[k++] = (*i)->getId();
}