#include "support/lstrings.h"
#include "support/filetools.h"
+#include <functional>
-using namespace lyx::support;
+using std::string;
+namespace lyx {
+
+using support::compare;
+using support::LibFileSearch;
+using support::subst;
+
+namespace frontend {
ControlMath::ControlMath(Dialog & dialog)
: Dialog::Controller(dialog)
void ControlMath::dispatchSubscript() const
{
- dispatchFunc(LFUN_SUBSCRIPT);
+ dispatchFunc(LFUN_INSERT_MATH, "_");
+ dispatchFunc(LFUN_DOWN);
}
void ControlMath::dispatchSuperscript() const
{
- dispatchFunc(LFUN_SUPERSCRIPT);
+ dispatchFunc(LFUN_INSERT_MATH, "^");
+ dispatchFunc(LFUN_UP);
}
"angle", "top", "bot", "Vert", "neg",
"flat", "natural", "sharp", "surd", "triangle",
"diamondsuit", "heartsuit", "clubsuit", "spadesuit",
- "textrm Å", "textrm Ø", "mathcircumflex", "_",
+ "textrm \\AA", "textrm \\O", "mathcircumflex", "_",
"mathrm T",
"mathbb N", "mathbb Z", "mathbb Q",
"mathbb R", "mathbb C", "mathbb H",
}
-struct CompareKey {
+class CompareKey : public std::unary_function<XPMmap, bool> {
+public:
CompareKey(string const & name) : name_(name) {}
- bool operator()(XPMmap const & other) {
- return compare(other.key, name_.c_str()) == 0;
+ bool operator()(XPMmap const & other) const {
+ return other.key == name_;
}
private:
string const name_;
{ "nRightarrow", "nrightarrow2" },
{ "nVDash", "nvdash3" },
{ "nvDash", "nvdash2" },
- { "textrm_Å", "textrm_A" },
- { "textrm_Ø", "textrm_0" },
+ { "textrm \\AA", "textrm_AA"},
+ { "textrm \\O", "textrm_Oe"},
{ "vDash", "vdash2" }
};
{
XPMmap const * const begin = sorted_xpm_map;
XPMmap const * const end = begin + nr_sorted_xpm_map;
- BOOST_ASSERT(lyx::sorted(begin, end));
+ BOOST_ASSERT(sorted(begin, end));
XPMmap const * const it =
std::find_if(begin, end, CompareKey(name));
return LibFileSearch("images/math/", xpm_name, "xpm");
}
+
+} // namespace frontend
+} // namespace lyx