this, SIGNAL(changed()));
// These are hardcoded and do not change
- std::map<std::string, std::string> const & ct =
+ std::vector<std::pair<std::string, std::string>> const & ct =
InsetCounter::counterTable;
actionCB->clear();
for (auto const & c : ct) {
{}
-const map<string, string> InsetCounter::counterTable =
+const vector<pair<string, string>> InsetCounter::counterTable =
{
{"set", N_("Set counter to ...")},
{"addto", N_("Increase counter by ...")},
};
-bool InsetCounter::isCompatibleCommand(string const & s) {
- return counterTable.count(s);
+bool InsetCounter::isCompatibleCommand(string const & s)
+{
+ for (auto & i : counterTable) {
+ if (i.first == s)
+ return true;
+ }
+ return false;
}
string const cmd = getCmdName();
docstring cntr = getParam("counter");
Counters & cnts = buffer().params().documentClass().counters();
- map<string, string>::const_iterator cit = counterTable.find(cmd);
- LASSERT(cit != counterTable.end(), return);
- string const label = cit->second;
+ string label;
+ for (auto & i : counterTable) {
+ if (i.first == cmd)
+ label = i.second;
+ }
+ LASSERT(!label.empty(), return);
docstring const tlabel = translateIfPossible(from_ascii(label));
if (cmd == "set") {
static bool isCompatibleCommand(std::string const & s);
//@}
/// keys are commands, values are GUI strings
- static const std::map<std::string, std::string> counterTable;
+ static const std::vector<std::pair<std::string, std::string>> counterTable;
static const std::map<std::string, std::string> valueTable;
protected: