format = lexrc.getString();
if (lexrc.eatLine())
command = lexrc.getString();
- viewer_alternatives.push_back(make_pair(format, command));
+ viewer_alternatives[format].insert(command);
break;
}
case RC_EDITOR_ALTERNATIVES: {
string format, command;
lexrc >> format >> command;
- editor_alternatives.push_back(make_pair(format, command));
+ editor_alternatives[format].insert(command);
break;
}
if (tag != RC_LAST)
break;
case RC_BIBTEX_ALTERNATIVES: {
- set<string>::const_iterator it = bibtex_alternatives.begin();
- set<string>::const_iterator end = bibtex_alternatives.end();
+ CommandSet::const_iterator it = bibtex_alternatives.begin();
+ CommandSet::const_iterator end = bibtex_alternatives.end();
for ( ; it != end; ++it) {
if (ignore_system_lyxrc
|| !system_lyxrc.bibtex_alternatives.count(*it))
if (tag != RC_LAST)
break;
case RC_INDEX_ALTERNATIVES: {
- set<string>::const_iterator it = index_alternatives.begin();
- set<string>::const_iterator end = index_alternatives.end();
+ CommandSet::const_iterator it = index_alternatives.begin();
+ CommandSet::const_iterator end = index_alternatives.end();
for ( ; it != end; ++it) {
if (ignore_system_lyxrc
|| !system_lyxrc.index_alternatives.count(*it))
<< "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
if (tag != RC_LAST)
break;
- case RC_VIEWER_ALTERNATIVES:
- if (ignore_system_lyxrc ||
- viewer_alternatives != system_lyxrc.viewer_alternatives) {
- for (vector<pair<string, string> >::const_iterator it = viewer_alternatives.begin();
- it != viewer_alternatives.end(); ++it)
- os << "\\viewer_alternatives "
- << it->first << " " << it->second << "\n";
+ case RC_VIEWER_ALTERNATIVES: {
+ Alternatives::const_iterator it = viewer_alternatives.begin();
+ Alternatives::const_iterator const en = viewer_alternatives.end();
+ Alternatives::const_iterator const sysend =
+ system_lyxrc.viewer_alternatives.end();
+ for (; it != en; ++it) {
+ string const & fmt = it->first;
+ CommandSet const & cmd = it->second;
+ CommandSet::const_iterator sit = cmd.begin();
+ CommandSet::const_iterator const sen = cmd.end();
+ Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
+ system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
+ system_lyxrc.viewer_alternatives.find(fmt);
+ for (; sit != sen; ++sit) {
+ string const & cmd = *sit;
+ if (ignore_system_lyxrc
+ || sysfmt == sysend // format not found
+ || sysfmt->second.count(cmd) == 0 // this command not found
+ )
+ os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
+ }
}
if (tag != RC_LAST)
break;
- case RC_EDITOR_ALTERNATIVES:
- if (ignore_system_lyxrc ||
- editor_alternatives != system_lyxrc.editor_alternatives) {
- for (vector<pair<string, string> >::const_iterator it = editor_alternatives.begin();
- it != editor_alternatives.end(); ++it)
- os << "\\editor_alternatives "
- << it->first << " " << it->second << "\n";
+ }
+ case RC_EDITOR_ALTERNATIVES: {
+ Alternatives::const_iterator it = editor_alternatives.begin();
+ Alternatives::const_iterator const en = editor_alternatives.end();
+ Alternatives::const_iterator const sysend =
+ system_lyxrc.editor_alternatives.end();
+ for (; it != en; ++it) {
+ string const & fmt = it->first;
+ CommandSet const & cmd = it->second;
+ CommandSet::const_iterator sit = cmd.begin();
+ CommandSet::const_iterator const sen = cmd.end();
+ Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
+ system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
+ system_lyxrc.editor_alternatives.find(fmt);
+ for (; sit != sen; ++sit) {
+ string const & cmd = *sit;
+ if (ignore_system_lyxrc
+ || sysfmt == sysend // format not found
+ || sysfmt->second.count(cmd) == 0 // this command not found
+ )
+ os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
+ }
}
if (tag != RC_LAST)
break;
+ }
case RC_DEFAULT_VIEW_FORMAT:
if (ignore_system_lyxrc ||
default_view_format != system_lyxrc.default_view_format) {
case LyXRC::RC_USE_PIXMAP_CACHE:
case LyXRC::RC_USE_SPELL_LIB:
case LyXRC::RC_VIEWDVI_PAPEROPTION:
+ case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
case LyXRC::RC_SORT_LAYOUTS:
case LyXRC::RC_FULL_SCREEN_LIMIT:
case LyXRC::RC_FULL_SCREEN_SCROLLBAR: