From f24806a4de551b14d80cd48b6b2b85d18af96080 Mon Sep 17 00:00:00 2001 From: twanvl Date: Thu, 15 Jan 2009 22:10:58 +0000 Subject: [PATCH] always call the combine function when expanding keywords git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1358 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/keyword.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/data/keyword.cpp b/src/data/keyword.cpp index 95df0296..8e1aa106 100644 --- a/src/data/keyword.cpp +++ b/src/data/keyword.cpp @@ -686,23 +686,18 @@ bool KeywordDatabase::tryExpand(const Keyword& kw, result += remove_tag(tagged.substr(0, start), _("toString(); - } catch (const Error& e) { - handle_error(_ERROR_2_("in keyword reminder", e.what(), kw.keyword), true, false); - } - ctx.setVariable(_("keyword"), to_script(total)); - ctx.setVariable(_("reminder"), to_script(reminder)); - result += _(""); - result += combine_script->eval(ctx)->toString(); - result += _(""); - } else { - result += _(""); - result += total; - result += _(""); + String reminder; + try { + reminder = kw.reminder.invoke(ctx)->toString(); + } catch (const Error& e) { + handle_error(_ERROR_2_("in keyword reminder", e.what(), kw.keyword), true, false); } + ctx.setVariable(_("keyword"), to_script(total)); + ctx.setVariable(_("reminder"), to_script(reminder)); + ctx.setVariable(_("expand"), to_script(expand)); + result += _(""); + result += combine_script->eval(ctx)->toString(); + result += _(""); // Add to usage statistics if (stat && stat_key) {