mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Small clean-up.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2445 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3c32875ece
commit
b155aa1ed5
@ -1,3 +1,9 @@
|
||||
2001-08-07 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* helper_funcs.C (getVectorFromString): fixed small bug.
|
||||
|
||||
* helper_funcs.h (getFirst, getSecond): cleaned up and removed cruft.
|
||||
|
||||
2001-08-07 Edwin Leuven <leuven@fee.uva.nl>
|
||||
|
||||
* ControlSpellchecker.C: check next word after insert in personal dict
|
||||
|
@ -60,8 +60,7 @@ vector<string> const getVectorFromString(string const & str,
|
||||
for(;;) {
|
||||
string::size_type const idx = keys.find(delim);
|
||||
if (idx == string::npos) {
|
||||
string const key = frontStrip(keys);
|
||||
vec.push_back(keys);
|
||||
vec.push_back(frontStrip(keys));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -49,36 +49,6 @@ string const browseFile(LyXView *lv, string const & filename,
|
||||
vector<pair<A,B> >
|
||||
*/
|
||||
|
||||
///
|
||||
template <class A, class B>
|
||||
std::vector<A> const getFirst(std::vector<std::pair<A,B> > const & pairVec)
|
||||
{
|
||||
typedef std::vector<std::pair<A,B> > PV;
|
||||
|
||||
std::vector<A> first(pairVec.size());
|
||||
|
||||
for (PV::size_type i = 0; i < pairVec.size(); ++i) {
|
||||
first[i] = pairVec[i].first;
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
///
|
||||
template <class A, class B>
|
||||
std::vector<B> const getSecond(std::vector<std::pair<A,B> > const & pairVec)
|
||||
{
|
||||
typedef std::vector<std::pair<A,B> > PV;
|
||||
|
||||
std::vector<B> second(pairVec.size());
|
||||
|
||||
for (PV::size_type i = 0; i < pairVec.size(); ++i) {
|
||||
second[i] = pairVec[i].second;
|
||||
}
|
||||
|
||||
return second;
|
||||
}
|
||||
|
||||
|
||||
template<class Pair>
|
||||
struct firster {
|
||||
typedef typename Pair::first_type first_type;
|
||||
@ -91,23 +61,25 @@ struct seconder {
|
||||
second_type const & operator()(Pair const & p) { return p.second; }
|
||||
};
|
||||
|
||||
///
|
||||
template<class Pair>
|
||||
typename Pair::first_type const getFirst(std::vector<Pair> const & pr)
|
||||
std::vector<typename Pair::first_type> const
|
||||
getFirst(std::vector<Pair> const & pr)
|
||||
{
|
||||
std::vector<typename Pair::first_type> tmp(pr.size);
|
||||
std::vector<typename Pair::first_type> tmp(pr.size());
|
||||
std::transform(pr.begin(), pr.end(), tmp.begin(), firster<Pair>());
|
||||
return tmp;
|
||||
}
|
||||
|
||||
///
|
||||
template<class Pair>
|
||||
typename Pair::second_type const getSecond(std::vector<Pair> const & pr)
|
||||
std::vector<typename Pair::second_type> const
|
||||
getSecond(std::vector<Pair> const & pr)
|
||||
{
|
||||
std::vector<typename Pair::second_type> tmp(pr.size);
|
||||
std::vector<typename Pair::second_type> tmp(pr.size());
|
||||
std::transform(pr.begin(), pr.end(), tmp.begin(), seconder<Pair>());
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // HELPERFUNCS_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user