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;
#include "support/strfwd.h"
+#include <set>
#include <string>
-#include <vector>
namespace lyx {
/// command to run chktex incl. options
std::string chktex_command;
/// all available commands to run bibtex incl. options
- std::vector<std::string> bibtex_alternatives;
+ std::set<std::string> bibtex_alternatives;
/// command to run bibtex incl. options
std::string bibtex_command;
/// command to run japanese bibtex incl. options
std::string jbibtex_command;
/// all available index commands incl. options
- std::vector<std::string> index_alternatives;
+ std::set<std::string> index_alternatives;
/// command to run makeindex incl. options or other index programs
std::string index_command;
/// command to run japanese index program incl. options
biblioModule->bibtexCO->clear();
biblioModule->bibtexCO->addItem(qt_("Default"), QString("default"));
- for (vector<string>::const_iterator it = lyxrc.bibtex_alternatives.begin();
+ for (set<string>::const_iterator it = lyxrc.bibtex_alternatives.begin();
it != lyxrc.bibtex_alternatives.end(); ++it) {
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
biblioModule->bibtexCO->addItem(command, command);
indexCO->clear();
indexCO->addItem(qt_("Default"), QString("default"));
- for (vector<string>::const_iterator it = lyxrc.index_alternatives.begin();
+ for (set<string>::const_iterator it = lyxrc.index_alternatives.begin();
it != lyxrc.index_alternatives.end(); ++it) {
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
indexCO->addItem(command, command);
latexBibtexOptionsLA->setText(qt_("C&ommand:"));
return;
}
- for (vector<string>::const_iterator it = bibtex_alternatives.begin();
+ for (set<string>::const_iterator it = bibtex_alternatives.begin();
it != bibtex_alternatives.end(); ++it) {
QString const bib = toqstr(*it);
int ind = bib.indexOf(" ");
latexIndexOptionsLA->setText(qt_("Co&mmand:"));
return;
}
- for (vector<string>::const_iterator it = index_alternatives.begin();
+ for (set<string>::const_iterator it = index_alternatives.begin();
it != index_alternatives.end(); ++it) {
QString const idx = toqstr(*it);
int ind = idx.indexOf(" ");
latexBibtexCO->clear();
latexBibtexCO->addItem(qt_("Custom"), QString());
- for (vector<string>::const_iterator it = rc.bibtex_alternatives.begin();
+ for (set<string>::const_iterator it = rc.bibtex_alternatives.begin();
it != rc.bibtex_alternatives.end(); ++it) {
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
latexBibtexCO->addItem(command, command);
latexIndexCO->clear();
latexIndexCO->addItem(qt_("Custom"), QString());
- for (vector<string>::const_iterator it = rc.index_alternatives.begin();
+ for (set<string>::const_iterator it = rc.index_alternatives.begin();
it != rc.index_alternatives.end(); ++it) {
QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
latexIndexCO->addItem(command, command);
private:
///
- std::vector<std::string> bibtex_alternatives;
+ std::set<std::string> bibtex_alternatives;
///
- std::vector<std::string> index_alternatives;
+ std::set<std::string> index_alternatives;
};