#include <algorithm>
#include <fstream>
-#include <locale>
using std::string;
using std::vector;
if (idx != docstring::npos)
return ltrim(fname.substr(0, idx));
idx = fname.rfind('.');
- if (idx != docstring::npos && idx < fname.size() - 1)
+ if (idx != docstring::npos && idx + 1 < fname.size())
fname = ltrim(fname.substr(idx + 1));
// test if we have a LaTeX Space in front
if (fname[0] == '\\')
LanguagePair, bool>
{
public:
- Sorter() : loc_("") {};
bool operator()(LanguagePair const & lhs,
LanguagePair const & rhs) const {
- return loc_(lhs.first, rhs.first);
+ return lhs.first < rhs.first;
+ }
+};
+
+
+class ColorSorter
+{
+public:
+ bool operator()(Color::color const & lhs,
+ Color::color const & rhs) const {
+ return lcolor.getGUIName(lhs) < lcolor.getGUIName(rhs);
}
-private:
- std::locale loc_;
};
} // namespace anon
return langs;
}
+
+vector<Color_color> const getSortedColors(vector<Color_color> colors)
+{
+ // sort the colors
+ std::sort(colors.begin(), colors.end(), ColorSorter());
+ return colors;
+}
+
} // namespace frontend
using support::addName;