case RC_BIBTEX_ALTERNATIVES:
if (lexrc.next(true)) {
- bibtex_alternatives.push_back(lexrc.getString());
+ bibtex_alternatives.insert(lexrc.getString());
}
break;
case RC_INDEX_ALTERNATIVES:
if (lexrc.next(true)) {
- index_alternatives.push_back(lexrc.getString());
+ index_alternatives.insert(lexrc.getString());
}
break;
if (tag != RC_LAST)
break;
case RC_BIBTEX_ALTERNATIVES: {
- vector<string>::const_iterator it = bibtex_alternatives.begin();
- vector<string>::const_iterator end = bibtex_alternatives.end();
- if (ignore_system_lyxrc) {
- for ( ; it != end; ++it)
+ set<string>::const_iterator it = bibtex_alternatives.begin();
+ set<string>::const_iterator end = bibtex_alternatives.end();
+ for ( ; it != end; ++it) {
+ if (ignore_system_lyxrc
+ || !system_lyxrc.bibtex_alternatives.count(*it))
os << "\\bibtex_alternatives \""
<< *it << "\"\n";
- } else {
- vector<string>::const_iterator sbeg =
- system_lyxrc.bibtex_alternatives.begin();
- vector<string>::const_iterator send =
- system_lyxrc.bibtex_alternatives.end();
- for ( ; it != end; ++it) {
- bool found = false;
- for (vector<string>::const_iterator sit = sbeg;
- sit != send; ++sit) {
- if (*it == *sit)
- found = true;
- }
- if (!found)
- os << "\\bibtex_alternatives \""
- << *it << "\"\n";
- }
}
if (tag != RC_LAST)
break;
if (tag != RC_LAST)
break;
case RC_INDEX_ALTERNATIVES: {
- vector<string>::const_iterator it = index_alternatives.begin();
- vector<string>::const_iterator end = index_alternatives.end();
- if (ignore_system_lyxrc) {
- for ( ; it != end; ++it)
+ set<string>::const_iterator it = index_alternatives.begin();
+ set<string>::const_iterator end = index_alternatives.end();
+ for ( ; it != end; ++it) {
+ if (ignore_system_lyxrc
+ || !system_lyxrc.index_alternatives.count(*it))
os << "\\index_alternatives \""
<< *it << "\"\n";
- } else {
- vector<string>::const_iterator sbeg =
- system_lyxrc.index_alternatives.begin();
- vector<string>::const_iterator send =
- system_lyxrc.index_alternatives.end();
- for ( ; it != end; ++it) {
- bool found = false;
- for (vector<string>::const_iterator sit = sbeg;
- sit != send; ++sit) {
- if (*it == *sit)
- found = true;
- }
- if (!found)
- os << "\\index_alternatives \""
- << *it << "\"\n";
- }
}
if (tag != RC_LAST)
break;