mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
more funcs to lowerchar, adjust
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2428 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8beaec704e
commit
a0bf0835e5
@ -1,3 +1,8 @@
|
|||||||
|
2001-08-06 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* lyxlex_pimpl.[Ch]: converto to lowercase funcs
|
||||||
|
* lyxlex.[hC]: ditto
|
||||||
|
|
||||||
2001-08-06 Juergen Vigna <jug@sad.it>
|
2001-08-06 Juergen Vigna <jug@sad.it>
|
||||||
|
|
||||||
* text.C (getVisibleRow): fix up row clearing a bit.
|
* text.C (getVisibleRow): fix up row clearing a bit.
|
||||||
|
@ -141,16 +141,16 @@ Menu & Menu::read(LyXLex & lex)
|
|||||||
bool quit = false;
|
bool quit = false;
|
||||||
bool optional = false;
|
bool optional = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !quit) {
|
while (lex.isOK() && !quit) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case md_optitem:
|
case md_optitem:
|
||||||
optional = true;
|
optional = true;
|
||||||
// fallback to md_item
|
// fallback to md_item
|
||||||
case md_item: {
|
case md_item: {
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
string const name = _(lex.GetString());
|
string const name = _(lex.getString());
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
string const command = lex.GetString();
|
string const command = lex.getString();
|
||||||
add(MenuItem(MenuItem::Command, name,
|
add(MenuItem(MenuItem::Command, name,
|
||||||
command, optional));
|
command, optional));
|
||||||
optional = false;
|
optional = false;
|
||||||
@ -199,9 +199,9 @@ Menu & Menu::read(LyXLex & lex)
|
|||||||
|
|
||||||
case md_submenu: {
|
case md_submenu: {
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
string mlabel = _(lex.GetString());
|
string const mlabel = _(lex.getString());
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
string mname = lex.GetString();
|
string const mname = lex.getString();
|
||||||
add(MenuItem(MenuItem::Submenu, mlabel, mname));
|
add(MenuItem(MenuItem::Submenu, mlabel, mname));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -432,9 +432,10 @@ void MenuBackend::read(LyXLex & lex)
|
|||||||
};
|
};
|
||||||
|
|
||||||
//consistency check
|
//consistency check
|
||||||
if (compare_no_case(lex.GetString(), "menuset"))
|
if (compare_no_case(lex.getString(), "menuset")) {
|
||||||
lyxerr << "Menubackend::read: ERROR wrong token:`"
|
lyxerr << "Menubackend::read: ERROR wrong token:`"
|
||||||
<< lex.GetString() << '\'' << endl;
|
<< lex.getString() << '\'' << endl;
|
||||||
|
}
|
||||||
|
|
||||||
lex.pushTable(menutags, md_last - 1);
|
lex.pushTable(menutags, md_last - 1);
|
||||||
if (lyxerr.debugging(Debug::PARSER))
|
if (lyxerr.debugging(Debug::PARSER))
|
||||||
@ -443,14 +444,14 @@ void MenuBackend::read(LyXLex & lex)
|
|||||||
bool quit = false;
|
bool quit = false;
|
||||||
bool menubar = false;
|
bool menubar = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !quit) {
|
while (lex.isOK() && !quit) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case md_menubar:
|
case md_menubar:
|
||||||
menubar = true;
|
menubar = true;
|
||||||
// fallback to md_menu
|
// fallback to md_menu
|
||||||
case md_menu: {
|
case md_menu: {
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
string name = lex.GetString();
|
string const name = lex.getString();
|
||||||
if (hasMenu(name)) {
|
if (hasMenu(name)) {
|
||||||
if (getMenu(name).menubar() == menubar) {
|
if (getMenu(name).menubar() == menubar) {
|
||||||
getMenu(name).read(lex);
|
getMenu(name).read(lex);
|
||||||
|
@ -95,13 +95,13 @@ struct keyword_item toolTags[TO_LAST - 1] = {
|
|||||||
void ToolbarDefaults::read(LyXLex & lex)
|
void ToolbarDefaults::read(LyXLex & lex)
|
||||||
{
|
{
|
||||||
//consistency check
|
//consistency check
|
||||||
if (compare_no_case(lex.GetString(), "toolbar"))
|
if (compare_no_case(lex.getString(), "toolbar")) {
|
||||||
lyxerr << "Toolbar::read: ERROR wrong token:`"
|
lyxerr << "Toolbar::read: ERROR wrong token:`"
|
||||||
<< lex.GetString() << '\'' << endl;
|
<< lex.getString() << '\'' << endl;
|
||||||
|
}
|
||||||
|
|
||||||
defaults.clear();
|
defaults.clear();
|
||||||
|
|
||||||
string func;
|
|
||||||
bool quit = false;
|
bool quit = false;
|
||||||
|
|
||||||
lex.pushTable(toolTags, TO_LAST - 1);
|
lex.pushTable(toolTags, TO_LAST - 1);
|
||||||
@ -109,11 +109,11 @@ void ToolbarDefaults::read(LyXLex & lex)
|
|||||||
if (lyxerr.debugging(Debug::PARSER))
|
if (lyxerr.debugging(Debug::PARSER))
|
||||||
lex.printTable(lyxerr);
|
lex.printTable(lyxerr);
|
||||||
|
|
||||||
while (lex.IsOK() && !quit) {
|
while (lex.isOK() && !quit) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case TO_ADD:
|
case TO_ADD:
|
||||||
if (lex.next(true)) {
|
if (lex.next(true)) {
|
||||||
func = lex.GetString();
|
string const func = lex.getString();
|
||||||
lyxerr[Debug::PARSER]
|
lyxerr[Debug::PARSER]
|
||||||
<< "Toolbar::read TO_ADD func: `"
|
<< "Toolbar::read TO_ADD func: `"
|
||||||
<< func << "'" << endl;
|
<< func << "'" << endl;
|
||||||
|
@ -356,7 +356,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
|||||||
<< keysym << "]" << endl;
|
<< keysym << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FL_REVISION < 89
|
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
|
||||||
if (keysym == NoSymbol) {
|
if (keysym == NoSymbol) {
|
||||||
lyxerr[Debug::KEY]
|
lyxerr[Debug::KEY]
|
||||||
<< "Empty kdb action (probably composing)"
|
<< "Empty kdb action (probably composing)"
|
||||||
|
178
src/buffer.C
178
src/buffer.C
@ -340,9 +340,9 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
|
|||||||
markDirty();
|
markDirty();
|
||||||
// We don't want to adopt the parameters from the
|
// We don't want to adopt the parameters from the
|
||||||
// document we insert, so we skip until the text begins:
|
// document we insert, so we skip until the text begins:
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string const pretoken = lex.GetString();
|
string const pretoken = lex.getString();
|
||||||
if (pretoken == "\\layout") {
|
if (pretoken == "\\layout") {
|
||||||
lex.pushToken(pretoken);
|
lex.pushToken(pretoken);
|
||||||
break;
|
break;
|
||||||
@ -350,9 +350,9 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
|
|
||||||
if (token.empty()) continue;
|
if (token.empty()) continue;
|
||||||
|
|
||||||
@ -449,8 +449,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
// Do the insetert.
|
// Do the insetert.
|
||||||
insertErtContents(par, pos, font);
|
insertErtContents(par, pos, font);
|
||||||
#endif
|
#endif
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
string const layoutname = lex.GetString();
|
string const layoutname = lex.getString();
|
||||||
pair<bool, LyXTextClass::LayoutList::size_type> pp
|
pair<bool, LyXTextClass::LayoutList::size_type> pp
|
||||||
= textclasslist.NumberOfLayout(params.textclass,
|
= textclasslist.NumberOfLayout(params.textclass,
|
||||||
layoutname);
|
layoutname);
|
||||||
@ -560,7 +560,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
// This is the compability reader. It can be removed in
|
// This is the compability reader. It can be removed in
|
||||||
// LyX version 1.3.0. (Lgb)
|
// LyX version 1.3.0. (Lgb)
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmptok = lex.GetString();
|
string const tmptok = lex.getString();
|
||||||
//lyxerr << "old float: " << tmptok << endl;
|
//lyxerr << "old float: " << tmptok << endl;
|
||||||
|
|
||||||
Inset * inset = 0;
|
Inset * inset = 0;
|
||||||
@ -612,7 +612,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
// This _is_ a hack! (Lgb)
|
// This _is_ a hack! (Lgb)
|
||||||
while (true) {
|
while (true) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmp = lex.GetString();
|
string const tmp = lex.getString();
|
||||||
if (tmp == "\\end_deeper") {
|
if (tmp == "\\end_deeper") {
|
||||||
//lyxerr << "\\end_deeper caught!" << endl;
|
//lyxerr << "\\end_deeper caught!" << endl;
|
||||||
if (!depth) {
|
if (!depth) {
|
||||||
@ -652,15 +652,15 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
} else if (token == "\\begin_preamble") {
|
} else if (token == "\\begin_preamble") {
|
||||||
params.readPreamble(lex);
|
params.readPreamble(lex);
|
||||||
} else if (token == "\\textclass") {
|
} else if (token == "\\textclass") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
pair<bool, LyXTextClassList::size_type> pp =
|
pair<bool, LyXTextClassList::size_type> pp =
|
||||||
textclasslist.NumberOfClass(lex.GetString());
|
textclasslist.NumberOfClass(lex.getString());
|
||||||
if (pp.first) {
|
if (pp.first) {
|
||||||
params.textclass = pp.second;
|
params.textclass = pp.second;
|
||||||
} else {
|
} else {
|
||||||
WriteAlert(string(_("Textclass error")),
|
WriteAlert(string(_("Textclass error")),
|
||||||
string(_("The document uses an unknown textclass \"")) +
|
string(_("The document uses an unknown textclass \"")) +
|
||||||
lex.GetString() + string("\"."),
|
lex.getString() + string("\"."),
|
||||||
string(_("LyX will not be able to produce output correctly.")));
|
string(_("LyX will not be able to produce output correctly.")));
|
||||||
params.textclass = 0;
|
params.textclass = 0;
|
||||||
}
|
}
|
||||||
@ -677,20 +677,20 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
params.textclass = 0;
|
params.textclass = 0;
|
||||||
}
|
}
|
||||||
} else if (token == "\\options") {
|
} else if (token == "\\options") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
params.options = lex.GetString();
|
params.options = lex.getString();
|
||||||
} else if (token == "\\language") {
|
} else if (token == "\\language") {
|
||||||
params.readLanguage(lex);
|
params.readLanguage(lex);
|
||||||
} else if (token == "\\fontencoding") {
|
} else if (token == "\\fontencoding") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
} else if (token == "\\inputencoding") {
|
} else if (token == "\\inputencoding") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
params.inputenc = lex.GetString();
|
params.inputenc = lex.getString();
|
||||||
} else if (token == "\\graphics") {
|
} else if (token == "\\graphics") {
|
||||||
params.readGraphicsDriver(lex);
|
params.readGraphicsDriver(lex);
|
||||||
} else if (token == "\\fontscheme") {
|
} else if (token == "\\fontscheme") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
params.fonts = lex.GetString();
|
params.fonts = lex.getString();
|
||||||
} else if (token == "\\noindent") {
|
} else if (token == "\\noindent") {
|
||||||
par->params().noindent(true);
|
par->params().noindent(true);
|
||||||
} else if (token == "\\fill_top") {
|
} else if (token == "\\fill_top") {
|
||||||
@ -708,21 +708,21 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
} else if (token == "\\start_of_appendix") {
|
} else if (token == "\\start_of_appendix") {
|
||||||
par->params().startOfAppendix(true);
|
par->params().startOfAppendix(true);
|
||||||
} else if (token == "\\paragraph_separation") {
|
} else if (token == "\\paragraph_separation") {
|
||||||
int tmpret = lex.FindToken(string_paragraph_separation);
|
int tmpret = lex.findToken(string_paragraph_separation);
|
||||||
if (tmpret == -1) ++tmpret;
|
if (tmpret == -1) ++tmpret;
|
||||||
if (tmpret != LYX_LAYOUT_DEFAULT)
|
if (tmpret != LYX_LAYOUT_DEFAULT)
|
||||||
params.paragraph_separation =
|
params.paragraph_separation =
|
||||||
static_cast<BufferParams::PARSEP>(tmpret);
|
static_cast<BufferParams::PARSEP>(tmpret);
|
||||||
} else if (token == "\\defskip") {
|
} else if (token == "\\defskip") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.defskip = VSpace(lex.GetString());
|
params.defskip = VSpace(lex.getString());
|
||||||
} else if (token == "\\epsfig") { // obsolete
|
} else if (token == "\\epsfig") { // obsolete
|
||||||
// Indeed it is obsolete, but we HAVE to be backwards
|
// Indeed it is obsolete, but we HAVE to be backwards
|
||||||
// compatible until 0.14, because otherwise all figures
|
// compatible until 0.14, because otherwise all figures
|
||||||
// in existing documents are irretrivably lost. (Asger)
|
// in existing documents are irretrivably lost. (Asger)
|
||||||
params.readGraphicsDriver(lex);
|
params.readGraphicsDriver(lex);
|
||||||
} else if (token == "\\quotes_language") {
|
} else if (token == "\\quotes_language") {
|
||||||
int tmpret = lex.FindToken(string_quotes_language);
|
int tmpret = lex.findToken(string_quotes_language);
|
||||||
if (tmpret == -1) ++tmpret;
|
if (tmpret == -1) ++tmpret;
|
||||||
if (tmpret != LYX_LAYOUT_DEFAULT) {
|
if (tmpret != LYX_LAYOUT_DEFAULT) {
|
||||||
InsetQuotes::quote_language tmpl =
|
InsetQuotes::quote_language tmpl =
|
||||||
@ -751,7 +751,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
}
|
}
|
||||||
} else if (token == "\\quotes_times") {
|
} else if (token == "\\quotes_times") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
switch (lex.GetInteger()) {
|
switch (lex.getInteger()) {
|
||||||
case 1:
|
case 1:
|
||||||
params.quotes_times = InsetQuotes::SingleQ;
|
params.quotes_times = InsetQuotes::SingleQ;
|
||||||
break;
|
break;
|
||||||
@ -760,13 +760,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (token == "\\papersize") {
|
} else if (token == "\\papersize") {
|
||||||
int tmpret = lex.FindToken(string_papersize);
|
int tmpret = lex.findToken(string_papersize);
|
||||||
if (tmpret == -1)
|
if (tmpret == -1)
|
||||||
++tmpret;
|
++tmpret;
|
||||||
else
|
else
|
||||||
params.papersize2 = tmpret;
|
params.papersize2 = tmpret;
|
||||||
} else if (token == "\\paperpackage") {
|
} else if (token == "\\paperpackage") {
|
||||||
int tmpret = lex.FindToken(string_paperpackages);
|
int tmpret = lex.findToken(string_paperpackages);
|
||||||
if (tmpret == -1) {
|
if (tmpret == -1) {
|
||||||
++tmpret;
|
++tmpret;
|
||||||
params.paperpackage = BufferParams::PACKAGE_NONE;
|
params.paperpackage = BufferParams::PACKAGE_NONE;
|
||||||
@ -774,81 +774,81 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
params.paperpackage = tmpret;
|
params.paperpackage = tmpret;
|
||||||
} else if (token == "\\use_geometry") {
|
} else if (token == "\\use_geometry") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.use_geometry = lex.GetInteger();
|
params.use_geometry = lex.getInteger();
|
||||||
} else if (token == "\\use_amsmath") {
|
} else if (token == "\\use_amsmath") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.use_amsmath = lex.GetInteger();
|
params.use_amsmath = lex.getInteger();
|
||||||
} else if (token == "\\use_natbib") {
|
} else if (token == "\\use_natbib") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.use_natbib = lex.GetInteger();
|
params.use_natbib = lex.getInteger();
|
||||||
} else if (token == "\\use_numerical_citations") {
|
} else if (token == "\\use_numerical_citations") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.use_numerical_citations = lex.GetInteger();
|
params.use_numerical_citations = lex.getInteger();
|
||||||
} else if (token == "\\paperorientation") {
|
} else if (token == "\\paperorientation") {
|
||||||
int tmpret = lex.FindToken(string_orientation);
|
int tmpret = lex.findToken(string_orientation);
|
||||||
if (tmpret == -1) ++tmpret;
|
if (tmpret == -1) ++tmpret;
|
||||||
if (tmpret != LYX_LAYOUT_DEFAULT)
|
if (tmpret != LYX_LAYOUT_DEFAULT)
|
||||||
params.orientation = static_cast<BufferParams::PAPER_ORIENTATION>(tmpret);
|
params.orientation = static_cast<BufferParams::PAPER_ORIENTATION>(tmpret);
|
||||||
} else if (token == "\\paperwidth") {
|
} else if (token == "\\paperwidth") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.paperwidth = lex.GetString();
|
params.paperwidth = lex.getString();
|
||||||
} else if (token == "\\paperheight") {
|
} else if (token == "\\paperheight") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.paperheight = lex.GetString();
|
params.paperheight = lex.getString();
|
||||||
} else if (token == "\\leftmargin") {
|
} else if (token == "\\leftmargin") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.leftmargin = lex.GetString();
|
params.leftmargin = lex.getString();
|
||||||
} else if (token == "\\topmargin") {
|
} else if (token == "\\topmargin") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.topmargin = lex.GetString();
|
params.topmargin = lex.getString();
|
||||||
} else if (token == "\\rightmargin") {
|
} else if (token == "\\rightmargin") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.rightmargin = lex.GetString();
|
params.rightmargin = lex.getString();
|
||||||
} else if (token == "\\bottommargin") {
|
} else if (token == "\\bottommargin") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.bottommargin = lex.GetString();
|
params.bottommargin = lex.getString();
|
||||||
} else if (token == "\\headheight") {
|
} else if (token == "\\headheight") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.headheight = lex.GetString();
|
params.headheight = lex.getString();
|
||||||
} else if (token == "\\headsep") {
|
} else if (token == "\\headsep") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.headsep = lex.GetString();
|
params.headsep = lex.getString();
|
||||||
} else if (token == "\\footskip") {
|
} else if (token == "\\footskip") {
|
||||||
lex.next();
|
lex.next();
|
||||||
params.footskip = lex.GetString();
|
params.footskip = lex.getString();
|
||||||
} else if (token == "\\paperfontsize") {
|
} else if (token == "\\paperfontsize") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.fontsize = strip(lex.GetString());
|
params.fontsize = strip(lex.getString());
|
||||||
} else if (token == "\\papercolumns") {
|
} else if (token == "\\papercolumns") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.columns = lex.GetInteger();
|
params.columns = lex.getInteger();
|
||||||
} else if (token == "\\papersides") {
|
} else if (token == "\\papersides") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
switch (lex.GetInteger()) {
|
switch (lex.getInteger()) {
|
||||||
default:
|
default:
|
||||||
case 1: params.sides = LyXTextClass::OneSide; break;
|
case 1: params.sides = LyXTextClass::OneSide; break;
|
||||||
case 2: params.sides = LyXTextClass::TwoSides; break;
|
case 2: params.sides = LyXTextClass::TwoSides; break;
|
||||||
}
|
}
|
||||||
} else if (token == "\\paperpagestyle") {
|
} else if (token == "\\paperpagestyle") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.pagestyle = strip(lex.GetString());
|
params.pagestyle = strip(lex.getString());
|
||||||
} else if (token == "\\bullet") {
|
} else if (token == "\\bullet") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
int const index = lex.GetInteger();
|
int const index = lex.getInteger();
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
int temp_int = lex.GetInteger();
|
int temp_int = lex.getInteger();
|
||||||
params.user_defined_bullets[index].setFont(temp_int);
|
params.user_defined_bullets[index].setFont(temp_int);
|
||||||
params.temp_bullets[index].setFont(temp_int);
|
params.temp_bullets[index].setFont(temp_int);
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
temp_int = lex.GetInteger();
|
temp_int = lex.getInteger();
|
||||||
params.user_defined_bullets[index].setCharacter(temp_int);
|
params.user_defined_bullets[index].setCharacter(temp_int);
|
||||||
params.temp_bullets[index].setCharacter(temp_int);
|
params.temp_bullets[index].setCharacter(temp_int);
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
temp_int = lex.GetInteger();
|
temp_int = lex.getInteger();
|
||||||
params.user_defined_bullets[index].setSize(temp_int);
|
params.user_defined_bullets[index].setSize(temp_int);
|
||||||
params.temp_bullets[index].setSize(temp_int);
|
params.temp_bullets[index].setSize(temp_int);
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string const temp_str = lex.GetString();
|
string const temp_str = lex.getString();
|
||||||
if (temp_str != "\\end_bullet") {
|
if (temp_str != "\\end_bullet") {
|
||||||
// this element isn't really necessary for
|
// this element isn't really necessary for
|
||||||
// parsing but is easier for humans
|
// parsing but is easier for humans
|
||||||
@ -859,9 +859,9 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
}
|
}
|
||||||
} else if (token == "\\bulletLaTeX") {
|
} else if (token == "\\bulletLaTeX") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
int const index = lex.GetInteger();
|
int const index = lex.getInteger();
|
||||||
lex.next();
|
lex.next();
|
||||||
string temp_str = lex.GetString();
|
string temp_str = lex.getString();
|
||||||
string sum_str;
|
string sum_str;
|
||||||
while (temp_str != "\\end_bullet") {
|
while (temp_str != "\\end_bullet") {
|
||||||
// this loop structure is needed when user
|
// this loop structure is needed when user
|
||||||
@ -872,19 +872,19 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
// therefore needs to be read in turn
|
// therefore needs to be read in turn
|
||||||
sum_str += temp_str;
|
sum_str += temp_str;
|
||||||
lex.next();
|
lex.next();
|
||||||
temp_str = lex.GetString();
|
temp_str = lex.getString();
|
||||||
}
|
}
|
||||||
params.user_defined_bullets[index].setText(sum_str);
|
params.user_defined_bullets[index].setText(sum_str);
|
||||||
params.temp_bullets[index].setText(sum_str);
|
params.temp_bullets[index].setText(sum_str);
|
||||||
} else if (token == "\\secnumdepth") {
|
} else if (token == "\\secnumdepth") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.secnumdepth = lex.GetInteger();
|
params.secnumdepth = lex.getInteger();
|
||||||
} else if (token == "\\tocdepth") {
|
} else if (token == "\\tocdepth") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.tocdepth = lex.GetInteger();
|
params.tocdepth = lex.getInteger();
|
||||||
} else if (token == "\\spacing") {
|
} else if (token == "\\spacing") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmp = strip(lex.GetString());
|
string const tmp = strip(lex.getString());
|
||||||
Spacing::Space tmp_space = Spacing::Default;
|
Spacing::Space tmp_space = Spacing::Default;
|
||||||
float tmp_val = 0.0;
|
float tmp_val = 0.0;
|
||||||
if (tmp == "single") {
|
if (tmp == "single") {
|
||||||
@ -896,7 +896,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
} else if (tmp == "other") {
|
} else if (tmp == "other") {
|
||||||
lex.next();
|
lex.next();
|
||||||
tmp_space = Spacing::Other;
|
tmp_space = Spacing::Other;
|
||||||
tmp_val = lex.GetFloat();
|
tmp_val = lex.getFloat();
|
||||||
} else {
|
} else {
|
||||||
lex.printError("Unknown spacing token: '$$Token'");
|
lex.printError("Unknown spacing token: '$$Token'");
|
||||||
}
|
}
|
||||||
@ -909,7 +909,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
}
|
}
|
||||||
} else if (token == "\\paragraph_spacing") {
|
} else if (token == "\\paragraph_spacing") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmp = strip(lex.GetString());
|
string const tmp = strip(lex.getString());
|
||||||
if (tmp == "single") {
|
if (tmp == "single") {
|
||||||
par->params().spacing(Spacing(Spacing::Single));
|
par->params().spacing(Spacing(Spacing::Single));
|
||||||
} else if (tmp == "onehalf") {
|
} else if (tmp == "onehalf") {
|
||||||
@ -919,29 +919,29 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
} else if (tmp == "other") {
|
} else if (tmp == "other") {
|
||||||
lex.next();
|
lex.next();
|
||||||
par->params().spacing(Spacing(Spacing::Other,
|
par->params().spacing(Spacing(Spacing::Other,
|
||||||
lex.GetFloat()));
|
lex.getFloat()));
|
||||||
} else {
|
} else {
|
||||||
lex.printError("Unknown spacing token: '$$Token'");
|
lex.printError("Unknown spacing token: '$$Token'");
|
||||||
}
|
}
|
||||||
} else if (token == "\\float_placement") {
|
} else if (token == "\\float_placement") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
params.float_placement = lex.GetString();
|
params.float_placement = lex.getString();
|
||||||
} else if (token == "\\family") {
|
} else if (token == "\\family") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setLyXFamily(lex.GetString());
|
font.setLyXFamily(lex.getString());
|
||||||
} else if (token == "\\series") {
|
} else if (token == "\\series") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setLyXSeries(lex.GetString());
|
font.setLyXSeries(lex.getString());
|
||||||
} else if (token == "\\shape") {
|
} else if (token == "\\shape") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setLyXShape(lex.GetString());
|
font.setLyXShape(lex.getString());
|
||||||
} else if (token == "\\size") {
|
} else if (token == "\\size") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setLyXSize(lex.GetString());
|
font.setLyXSize(lex.getString());
|
||||||
#ifndef NO_COMPABILITY
|
#ifndef NO_COMPABILITY
|
||||||
} else if (token == "\\latex") {
|
} else if (token == "\\latex") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tok = lex.GetString();
|
string const tok = lex.getString();
|
||||||
if (tok == "no_latex") {
|
if (tok == "no_latex") {
|
||||||
// Do the insetert.
|
// Do the insetert.
|
||||||
insertErtContents(par, pos, font);
|
insertErtContents(par, pos, font);
|
||||||
@ -957,7 +957,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
#endif
|
#endif
|
||||||
} else if (token == "\\lang") {
|
} else if (token == "\\lang") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tok = lex.GetString();
|
string const tok = lex.getString();
|
||||||
Language const * lang = languages.getLanguage(tok);
|
Language const * lang = languages.getLanguage(tok);
|
||||||
if (lang) {
|
if (lang) {
|
||||||
font.setLanguage(lang);
|
font.setLanguage(lang);
|
||||||
@ -967,13 +967,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
}
|
}
|
||||||
} else if (token == "\\numeric") {
|
} else if (token == "\\numeric") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setNumber(font.setLyXMisc(lex.GetString()));
|
font.setNumber(font.setLyXMisc(lex.getString()));
|
||||||
} else if (token == "\\emph") {
|
} else if (token == "\\emph") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setEmph(font.setLyXMisc(lex.GetString()));
|
font.setEmph(font.setLyXMisc(lex.getString()));
|
||||||
} else if (token == "\\bar") {
|
} else if (token == "\\bar") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tok = lex.GetString();
|
string const tok = lex.getString();
|
||||||
// This is dirty, but gone with LyX3. (Asger)
|
// This is dirty, but gone with LyX3. (Asger)
|
||||||
if (tok == "under")
|
if (tok == "under")
|
||||||
font.setUnderbar(LyXFont::ON);
|
font.setUnderbar(LyXFont::ON);
|
||||||
@ -986,12 +986,12 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
"`$$Token'");
|
"`$$Token'");
|
||||||
} else if (token == "\\noun") {
|
} else if (token == "\\noun") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setNoun(font.setLyXMisc(lex.GetString()));
|
font.setNoun(font.setLyXMisc(lex.getString()));
|
||||||
} else if (token == "\\color") {
|
} else if (token == "\\color") {
|
||||||
lex.next();
|
lex.next();
|
||||||
font.setLyXColor(lex.GetString());
|
font.setLyXColor(lex.getString());
|
||||||
} else if (token == "\\align") {
|
} else if (token == "\\align") {
|
||||||
int tmpret = lex.FindToken(string_align);
|
int tmpret = lex.findToken(string_align);
|
||||||
if (tmpret == -1) ++tmpret;
|
if (tmpret == -1) ++tmpret;
|
||||||
if (tmpret != LYX_LAYOUT_DEFAULT) { // tmpret != 99 ???
|
if (tmpret != LYX_LAYOUT_DEFAULT) { // tmpret != 99 ???
|
||||||
int const tmpret2 = int(pow(2.0, tmpret));
|
int const tmpret2 = int(pow(2.0, tmpret));
|
||||||
@ -1000,35 +1000,35 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
}
|
}
|
||||||
} else if (token == "\\added_space_top") {
|
} else if (token == "\\added_space_top") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().spaceTop(VSpace(lex.GetString()));
|
par->params().spaceTop(VSpace(lex.getString()));
|
||||||
} else if (token == "\\added_space_bottom") {
|
} else if (token == "\\added_space_bottom") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().spaceBottom(VSpace(lex.GetString()));
|
par->params().spaceBottom(VSpace(lex.getString()));
|
||||||
#ifndef NO_COMPABILITY
|
#ifndef NO_COMPABILITY
|
||||||
#ifndef NO_PEXTRA_REALLY
|
#ifndef NO_PEXTRA_REALLY
|
||||||
} else if (token == "\\pextra_type") {
|
} else if (token == "\\pextra_type") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraType(lex.GetInteger());
|
par->params().pextraType(lex.getInteger());
|
||||||
} else if (token == "\\pextra_width") {
|
} else if (token == "\\pextra_width") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraWidth(lex.GetString());
|
par->params().pextraWidth(lex.getString());
|
||||||
} else if (token == "\\pextra_widthp") {
|
} else if (token == "\\pextra_widthp") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraWidthp(lex.GetString());
|
par->params().pextraWidthp(lex.getString());
|
||||||
} else if (token == "\\pextra_alignment") {
|
} else if (token == "\\pextra_alignment") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraAlignment(lex.GetInteger());
|
par->params().pextraAlignment(lex.getInteger());
|
||||||
} else if (token == "\\pextra_hfill") {
|
} else if (token == "\\pextra_hfill") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraHfill(lex.GetInteger());
|
par->params().pextraHfill(lex.getInteger());
|
||||||
} else if (token == "\\pextra_start_minipage") {
|
} else if (token == "\\pextra_start_minipage") {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
par->params().pextraStartMinipage(lex.GetInteger());
|
par->params().pextraStartMinipage(lex.getInteger());
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
} else if (token == "\\labelwidthstring") {
|
} else if (token == "\\labelwidthstring") {
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
par->params().labelWidthString(lex.GetString());
|
par->params().labelWidthString(lex.getString());
|
||||||
// do not delete this token, it is still needed!
|
// do not delete this token, it is still needed!
|
||||||
} else if (token == "\\end_inset") {
|
} else if (token == "\\end_inset") {
|
||||||
lyxerr << "Solitary \\end_inset. Missing \\begin_inset?.\n"
|
lyxerr << "Solitary \\end_inset. Missing \\begin_inset?.\n"
|
||||||
@ -1057,9 +1057,9 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
|
|||||||
|
|
||||||
// Insets don't make sense in a free-spacing context! ---Kayvan
|
// Insets don't make sense in a free-spacing context! ---Kayvan
|
||||||
if (layout.free_spacing) {
|
if (layout.free_spacing) {
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string next_token = lex.GetString();
|
string next_token = lex.getString();
|
||||||
if (next_token == "\\-") {
|
if (next_token == "\\-") {
|
||||||
par->insertChar(pos, '-', font);
|
par->insertChar(pos, '-', font);
|
||||||
} else if (next_token == "\\protected_separator"
|
} else if (next_token == "\\protected_separator"
|
||||||
@ -1386,7 +1386,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
|
|||||||
int & pos, LyXFont & font)
|
int & pos, LyXFont & font)
|
||||||
{
|
{
|
||||||
// consistency check
|
// consistency check
|
||||||
if (lex.GetString() != "\\begin_inset") {
|
if (lex.getString() != "\\begin_inset") {
|
||||||
lyxerr << "Buffer::readInset: Consistency check failed."
|
lyxerr << "Buffer::readInset: Consistency check failed."
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -1394,7 +1394,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
|
|||||||
Inset * inset = 0;
|
Inset * inset = 0;
|
||||||
|
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmptok = lex.GetString();
|
string const tmptok = lex.getString();
|
||||||
last_inset_read = tmptok;
|
last_inset_read = tmptok;
|
||||||
|
|
||||||
// test the different insets
|
// test the different insets
|
||||||
@ -1483,7 +1483,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
|
|||||||
inset = new InsetMinipage;
|
inset = new InsetMinipage;
|
||||||
} else if (tmptok == "Float") {
|
} else if (tmptok == "Float") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string tmptok = lex.GetString();
|
string tmptok = lex.getString();
|
||||||
inset = new InsetFloat(tmptok);
|
inset = new InsetFloat(tmptok);
|
||||||
#if 0
|
#if 0
|
||||||
} else if (tmptok == "List") {
|
} else if (tmptok == "List") {
|
||||||
@ -1509,12 +1509,12 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
|
|||||||
|
|
||||||
bool Buffer::readFile(LyXLex & lex, Paragraph * par)
|
bool Buffer::readFile(LyXLex & lex, Paragraph * par)
|
||||||
{
|
{
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token(lex.GetString());
|
string const token(lex.getString());
|
||||||
if (token == "\\lyxformat") { // the first token _must_ be...
|
if (token == "\\lyxformat") { // the first token _must_ be...
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
string tmp_format = lex.GetString();
|
string tmp_format = lex.getString();
|
||||||
//lyxerr << "LyX Format: `" << tmp_format << "'" << endl;
|
//lyxerr << "LyX Format: `" << tmp_format << "'" << endl;
|
||||||
// if present remove ".," from string.
|
// if present remove ".," from string.
|
||||||
string::size_type dot = tmp_format.find_first_of(".,");
|
string::size_type dot = tmp_format.find_first_of(".,");
|
||||||
@ -2815,7 +2815,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
|
|||||||
LyXFont::FONT_SHAPE shape_type = LyXFont::UP_SHAPE;
|
LyXFont::FONT_SHAPE shape_type = LyXFont::UP_SHAPE;
|
||||||
bool is_em = false;
|
bool is_em = false;
|
||||||
|
|
||||||
stack < PAR_TAG > tag_state;
|
stack<PAR_TAG> tag_state;
|
||||||
// parsing main loop
|
// parsing main loop
|
||||||
for (Paragraph::size_type i = 0; i < par->size(); ++i) {
|
for (Paragraph::size_type i = 0; i < par->size(); ++i) {
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
|
|||||||
bool templateok = false;
|
bool templateok = false;
|
||||||
LyXLex lex(0, 0);
|
LyXLex lex(0, 0);
|
||||||
lex.setFile(tname);
|
lex.setFile(tname);
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
if (b->readFile(lex)) {
|
if (b->readFile(lex)) {
|
||||||
templateok = true;
|
templateok = true;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ void BufferParams::useClassDefaults() {
|
|||||||
|
|
||||||
void BufferParams::readPreamble(LyXLex & lex)
|
void BufferParams::readPreamble(LyXLex & lex)
|
||||||
{
|
{
|
||||||
if (lex.GetString() != "\\begin_preamble")
|
if (lex.getString() != "\\begin_preamble")
|
||||||
lyxerr << "Error (BufferParams::readPreamble):"
|
lyxerr << "Error (BufferParams::readPreamble):"
|
||||||
"consistency check failed." << endl;
|
"consistency check failed." << endl;
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ void BufferParams::readLanguage(LyXLex & lex)
|
|||||||
{
|
{
|
||||||
if (!lex.next()) return;
|
if (!lex.next()) return;
|
||||||
|
|
||||||
string const tmptok = lex.GetString();
|
string const tmptok = lex.getString();
|
||||||
|
|
||||||
// check if tmptok is part of tex_babel in tex-defs.h
|
// check if tmptok is part of tex_babel in tex-defs.h
|
||||||
language = languages.getLanguage(tmptok);
|
language = languages.getLanguage(tmptok);
|
||||||
@ -221,7 +221,7 @@ void BufferParams::readGraphicsDriver(LyXLex & lex)
|
|||||||
{
|
{
|
||||||
if (!lex.next()) return;
|
if (!lex.next()) return;
|
||||||
|
|
||||||
string const tmptok = lex.GetString();
|
string const tmptok = lex.getString();
|
||||||
// check if tmptok is part of tex_graphics in tex_defs.h
|
// check if tmptok is part of tex_graphics in tex_defs.h
|
||||||
int n = 0;
|
int n = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -282,7 +282,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#warning why is a pointer returned and not a const reference? (Lgb)
|
|
||||||
Converter const * Converters::getConverter(string const & from,
|
Converter const * Converters::getConverter(string const & from,
|
||||||
string const & to)
|
string const & to)
|
||||||
{
|
{
|
||||||
|
@ -308,19 +308,19 @@ void Encodings::read(string const & filename)
|
|||||||
|
|
||||||
LyXLex lex(encodingtags, et_last - 1);
|
LyXLex lex(encodingtags, et_last - 1);
|
||||||
lex.setFile(filename);
|
lex.setFile(filename);
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case et_encoding:
|
case et_encoding:
|
||||||
{
|
{
|
||||||
lex.next();
|
lex.next();
|
||||||
string name = lex.GetString();
|
string const name = lex.getString();
|
||||||
lex.next();
|
lex.next();
|
||||||
string latexname = lex.GetString();
|
string const latexname = lex.getString();
|
||||||
lyxerr[Debug::INIT] << "Reading encoding " << name << endl;
|
lyxerr[Debug::INIT] << "Reading encoding " << name << endl;
|
||||||
Uchar table[256];
|
Uchar table[256];
|
||||||
for (unsigned int i = 0; i < 256; ++i) {
|
for (unsigned int i = 0; i < 256; ++i) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string tmp = lex.GetString();
|
string const tmp = lex.getString();
|
||||||
table[i] = ::strtol(tmp.c_str(), 0 , 16);
|
table[i] = ::strtol(tmp.c_str(), 0 , 16);
|
||||||
}
|
}
|
||||||
encodinglist[name] = Encoding(name, latexname, table);
|
encodinglist[name] = Encoding(name, latexname, table);
|
||||||
|
@ -45,28 +45,33 @@ void Languages::read(string const & filename)
|
|||||||
{
|
{
|
||||||
LyXLex lex(0, 0);
|
LyXLex lex(0, 0);
|
||||||
lex.setFile(filename);
|
lex.setFile(filename);
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
string lang, babel, display, encoding_str, code, latex_options;
|
string lang;
|
||||||
|
string babel;
|
||||||
|
string display;
|
||||||
|
string encoding_str;
|
||||||
|
string code;
|
||||||
|
string latex_options;
|
||||||
bool rtl = false;
|
bool rtl = false;
|
||||||
|
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
lang = lex.GetString();
|
lang = lex.getString();
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
lyxerr[Debug::INIT] << "Reading language " << lang << endl;
|
lyxerr[Debug::INIT] << "Reading language " << lang << endl;
|
||||||
|
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
babel = lex.GetString();
|
babel = lex.getString();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
display = lex.GetString();
|
display = lex.getString();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
rtl = lex.GetBool();
|
rtl = lex.getBool();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
encoding_str = lex.GetString();
|
encoding_str = lex.getString();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
code = lex.GetString();
|
code = lex.getString();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
latex_options = lex.GetString();
|
latex_options = lex.getString();
|
||||||
|
|
||||||
Encoding const * encoding = encodings.getEncoding(encoding_str);
|
Encoding const * encoding = encodings.getEncoding(encoding_str);
|
||||||
if (!encoding) {
|
if (!encoding) {
|
||||||
|
122
src/layout.C
122
src/layout.C
@ -189,7 +189,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
bool finished = false;
|
bool finished = false;
|
||||||
lexrc.pushTable(layoutTags, LT_INTITLE);
|
lexrc.pushTable(layoutTags, LT_INTITLE);
|
||||||
// parse style section
|
// parse style section
|
||||||
while (!finished && lexrc.IsOK() && !error) {
|
while (!finished && lexrc.isOK() && !error) {
|
||||||
int le = lexrc.lex();
|
int le = lexrc.lex();
|
||||||
// See comment in lyxrc.C.
|
// See comment in lyxrc.C.
|
||||||
switch (le) {
|
switch (le) {
|
||||||
@ -209,9 +209,9 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
|
|
||||||
case LT_COPYSTYLE: // initialize with a known style
|
case LT_COPYSTYLE: // initialize with a known style
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
if (tclass.hasLayout(lexrc.GetString())) {
|
if (tclass.hasLayout(lexrc.getString())) {
|
||||||
string tmpname = name_;
|
string const tmpname = name_;
|
||||||
this->operator= (tclass.GetLayout(lexrc.GetString()));
|
this->operator= (tclass.GetLayout(lexrc.getString()));
|
||||||
name_ = tmpname;
|
name_ = tmpname;
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("Cannot copy known "
|
lexrc.printError("Cannot copy known "
|
||||||
@ -222,12 +222,12 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
|
|
||||||
case LT_OBSOLETEDBY: // replace with a known style
|
case LT_OBSOLETEDBY: // replace with a known style
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
if (tclass.hasLayout(lexrc.GetString())) {
|
if (tclass.hasLayout(lexrc.getString())) {
|
||||||
string tmpname = name_;
|
string const tmpname = name_;
|
||||||
this->operator= (tclass.GetLayout(lexrc.GetString()));
|
this->operator= (tclass.GetLayout(lexrc.getString()));
|
||||||
name_ = tmpname;
|
name_ = tmpname;
|
||||||
if (obsoleted_by().empty())
|
if (obsoleted_by().empty())
|
||||||
obsoleted_by_ = lexrc.GetString();
|
obsoleted_by_ = lexrc.getString();
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("Cannot replace with"
|
lexrc.printError("Cannot replace with"
|
||||||
" unknown style "
|
" unknown style "
|
||||||
@ -245,15 +245,15 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_INTITLE:
|
case LT_INTITLE:
|
||||||
intitle = lexrc.next() && lexrc.GetInteger();
|
intitle = lexrc.next() && lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_NEED_PROTECT:
|
case LT_NEED_PROTECT:
|
||||||
needprotect = lexrc.next() && lexrc.GetInteger();
|
needprotect = lexrc.next() && lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_KEEPEMPTY:
|
case LT_KEEPEMPTY:
|
||||||
keepempty = lexrc.next() && lexrc.GetInteger();
|
keepempty = lexrc.next() && lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_FONT:
|
case LT_FONT:
|
||||||
@ -270,7 +270,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_NEXTNOINDENT: // Indent next paragraph?
|
case LT_NEXTNOINDENT: // Indent next paragraph?
|
||||||
if (lexrc.next() && lexrc.GetInteger())
|
if (lexrc.next() && lexrc.getInteger())
|
||||||
nextnoindent = true;
|
nextnoindent = true;
|
||||||
else
|
else
|
||||||
nextnoindent = false;
|
nextnoindent = false;
|
||||||
@ -278,12 +278,12 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
|
|
||||||
case LT_LATEXNAME:
|
case LT_LATEXNAME:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
latexname_ = lexrc.GetString();
|
latexname_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LATEXPARAM:
|
case LT_LATEXPARAM:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
latexparam_ = lexrc.GetString();
|
latexparam_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_PREAMBLE:
|
case LT_PREAMBLE:
|
||||||
@ -300,73 +300,73 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
|
|
||||||
case LT_LEFTMARGIN: // left margin type
|
case LT_LEFTMARGIN: // left margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
leftmargin = lexrc.GetString();
|
leftmargin = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_RIGHTMARGIN: // right margin type
|
case LT_RIGHTMARGIN: // right margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
rightmargin = lexrc.GetString();
|
rightmargin = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABELINDENT: // label indenting flag
|
case LT_LABELINDENT: // label indenting flag
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
labelindent = lexrc.GetString();
|
labelindent = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_PARINDENT: // paragraph indent. flag
|
case LT_PARINDENT: // paragraph indent. flag
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
parindent = lexrc.GetString();
|
parindent = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_PARSKIP: // paragraph skip size
|
case LT_PARSKIP: // paragraph skip size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
parskip = lexrc.GetFloat();
|
parskip = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_ITEMSEP: // item separation size
|
case LT_ITEMSEP: // item separation size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
itemsep = lexrc.GetFloat();
|
itemsep = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_TOPSEP: // top separation size
|
case LT_TOPSEP: // top separation size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
topsep = lexrc.GetFloat();
|
topsep = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_BOTTOMSEP: // bottom separation size
|
case LT_BOTTOMSEP: // bottom separation size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
bottomsep = lexrc.GetFloat();
|
bottomsep = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABEL_BOTTOMSEP: // label bottom separation size
|
case LT_LABEL_BOTTOMSEP: // label bottom separation size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
labelbottomsep = lexrc.GetFloat();
|
labelbottomsep = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABELSEP: // label separator
|
case LT_LABELSEP: // label separator
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
labelsep = subst(lexrc.GetString(), 'x', ' ');
|
labelsep = subst(lexrc.getString(), 'x', ' ');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_PARSEP: // par. separation size
|
case LT_PARSEP: // par. separation size
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
parsep = lexrc.GetFloat();
|
parsep = lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_FILL_TOP: // fill top flag
|
case LT_FILL_TOP: // fill top flag
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
fill_top = lexrc.GetInteger();
|
fill_top = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_FILL_BOTTOM: // fill bottom flag
|
case LT_FILL_BOTTOM: // fill bottom flag
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
fill_bottom = lexrc.GetInteger();
|
fill_bottom = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_NEWLINE: // newlines allowed?
|
case LT_NEWLINE: // newlines allowed?
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
newline_allowed = lexrc.GetInteger();
|
newline_allowed = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_ALIGN: // paragraph align
|
case LT_ALIGN: // paragraph align
|
||||||
@ -378,27 +378,27 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
|
|||||||
|
|
||||||
case LT_LABELSTRING: // label string definition
|
case LT_LABELSTRING: // label string definition
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
labelstring_ = lexrc.GetString();
|
labelstring_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_ENDLABELSTRING: // endlabel string definition
|
case LT_ENDLABELSTRING: // endlabel string definition
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
endlabelstring_ = lexrc.GetString();
|
endlabelstring_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_LABELSTRING_APPENDIX: // label string appendix definition
|
case LT_LABELSTRING_APPENDIX: // label string appendix definition
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
labelstring_appendix_ = lexrc.GetString();
|
labelstring_appendix_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_FREE_SPACING: // Allow for free spacing.
|
case LT_FREE_SPACING: // Allow for free spacing.
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
free_spacing = lexrc.GetInteger();
|
free_spacing = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_PASS_THRU: // Allow for pass thru.
|
case LT_PASS_THRU: // Allow for pass thru.
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
pass_thru = lexrc.GetInteger();
|
pass_thru = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LT_SPACING: // setspace.sty
|
case LT_SPACING: // setspace.sty
|
||||||
@ -470,7 +470,7 @@ void LyXLayout::readAlignPossible(LyXLex & lexrc)
|
|||||||
|
|
||||||
lexrc.pushTable(alignTags, AT_LAYOUT);
|
lexrc.pushTable(alignTags, AT_LAYOUT);
|
||||||
alignpossible = LYX_ALIGN_NONE;
|
alignpossible = LYX_ALIGN_NONE;
|
||||||
int lineno = lexrc.GetLineNo();
|
int lineno = lexrc.getLineNo();
|
||||||
do {
|
do {
|
||||||
int le = lexrc.lex();
|
int le = lexrc.lex();
|
||||||
switch (le) {
|
switch (le) {
|
||||||
@ -496,7 +496,7 @@ void LyXLayout::readAlignPossible(LyXLex & lexrc)
|
|||||||
alignpossible |= LYX_ALIGN_LAYOUT;
|
alignpossible |= LYX_ALIGN_LAYOUT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (lineno == lexrc.GetLineNo());
|
} while (lineno == lexrc.getLineNo());
|
||||||
lexrc.popTable();
|
lexrc.popTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -743,7 +743,7 @@ void LyXLayout::readSpacing(LyXLex & lexrc)
|
|||||||
break;
|
break;
|
||||||
case ST_OTHER:
|
case ST_OTHER:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
spacing.set(Spacing::Other, lexrc.GetFloat());
|
spacing.set(Spacing::Other, lexrc.getFloat());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -845,10 +845,10 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
lexrc.setFile(filename);
|
lexrc.setFile(filename);
|
||||||
if (!lexrc.IsOK()) error = true;
|
if (!lexrc.isOK()) error = true;
|
||||||
|
|
||||||
// parsing
|
// parsing
|
||||||
while (lexrc.IsOK() && !error) {
|
while (lexrc.isOK() && !error) {
|
||||||
int le = lexrc.lex();
|
int le = lexrc.lex();
|
||||||
switch (le) {
|
switch (le) {
|
||||||
case LyXLex::LEX_FEOF:
|
case LyXLex::LEX_FEOF:
|
||||||
@ -868,7 +868,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
case TC_INPUT: // Include file
|
case TC_INPUT: // Include file
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string tmp = LibFileSearch("layouts",
|
string tmp = LibFileSearch("layouts",
|
||||||
lexrc.GetString(),
|
lexrc.getString(),
|
||||||
"layout");
|
"layout");
|
||||||
|
|
||||||
if (Read(tmp, true)) {
|
if (Read(tmp, true)) {
|
||||||
@ -881,7 +881,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
|
|
||||||
case TC_STYLE:
|
case TC_STYLE:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string name = subst(lexrc.GetString(),
|
string name = subst(lexrc.getString(),
|
||||||
'_', ' ');
|
'_', ' ');
|
||||||
if (hasLayout(name)) {
|
if (hasLayout(name)) {
|
||||||
LyXLayout & lay = GetLayout(name);
|
LyXLayout & lay = GetLayout(name);
|
||||||
@ -901,7 +901,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
|
|
||||||
case TC_NOSTYLE:
|
case TC_NOSTYLE:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string style = subst(lexrc.GetString(),
|
string const style = subst(lexrc.getString(),
|
||||||
'_', ' ');
|
'_', ' ');
|
||||||
if (!delete_layout(style))
|
if (!delete_layout(style))
|
||||||
lexrc.printError("Cannot delete style"
|
lexrc.printError("Cannot delete style"
|
||||||
@ -911,12 +911,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
|
|
||||||
case TC_COLUMNS:
|
case TC_COLUMNS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
columns_ = lexrc.GetInteger();
|
columns_ = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_SIDES:
|
case TC_SIDES:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
switch (lexrc.GetInteger()) {
|
switch (lexrc.getInteger()) {
|
||||||
case 1: sides_ = OneSide; break;
|
case 1: sides_ = OneSide; break;
|
||||||
case 2: sides_ = TwoSides; break;
|
case 2: sides_ = TwoSides; break;
|
||||||
default:
|
default:
|
||||||
@ -931,7 +931,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
|
|
||||||
case TC_PAGESTYLE:
|
case TC_PAGESTYLE:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
pagestyle_ = strip(lexrc.GetString());
|
pagestyle_ = strip(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_DEFAULTFONT:
|
case TC_DEFAULTFONT:
|
||||||
@ -950,12 +950,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
|
|
||||||
case TC_SECNUMDEPTH:
|
case TC_SECNUMDEPTH:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
secnumdepth_ = lexrc.GetInteger();
|
secnumdepth_ = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_TOCDEPTH:
|
case TC_TOCDEPTH:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
tocdepth_ = lexrc.GetInteger();
|
tocdepth_ = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// First step to support options
|
// First step to support options
|
||||||
@ -968,28 +968,28 @@ bool LyXTextClass::Read(string const & filename, bool merge)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_PROVIDESAMSMATH:
|
case TC_PROVIDESAMSMATH:
|
||||||
if (lexrc.next() && lexrc.GetInteger())
|
if (lexrc.next() && lexrc.getInteger())
|
||||||
provides_ |= amsmath;
|
provides_ |= amsmath;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_PROVIDESMAKEIDX:
|
case TC_PROVIDESMAKEIDX:
|
||||||
if (lexrc.next() && lexrc.GetInteger())
|
if (lexrc.next() && lexrc.getInteger())
|
||||||
provides_ |= makeidx;
|
provides_ |= makeidx;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_PROVIDESURL:
|
case TC_PROVIDESURL:
|
||||||
if (lexrc.next() && lexrc.GetInteger())
|
if (lexrc.next() && lexrc.getInteger())
|
||||||
provides_ = url;
|
provides_ = url;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_LEFTMARGIN: // left margin type
|
case TC_LEFTMARGIN: // left margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
leftmargin_ = lexrc.GetString();
|
leftmargin_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_RIGHTMARGIN: // right margin type
|
case TC_RIGHTMARGIN: // right margin type
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
rightmargin_ = lexrc.GetString();
|
rightmargin_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1129,7 +1129,7 @@ void LyXTextClass::readClassOptions(LyXLex & lexrc)
|
|||||||
|
|
||||||
lexrc.pushTable(classOptionsTags, CO_END);
|
lexrc.pushTable(classOptionsTags, CO_END);
|
||||||
bool getout = false;
|
bool getout = false;
|
||||||
while (!getout && lexrc.IsOK()) {
|
while (!getout && lexrc.isOK()) {
|
||||||
int le = lexrc.lex();
|
int le = lexrc.lex();
|
||||||
switch (le) {
|
switch (le) {
|
||||||
case LyXLex::LEX_UNDEF:
|
case LyXLex::LEX_UNDEF:
|
||||||
@ -1140,15 +1140,15 @@ void LyXTextClass::readClassOptions(LyXLex & lexrc)
|
|||||||
switch (static_cast<ClassOptionsTags>(le)) {
|
switch (static_cast<ClassOptionsTags>(le)) {
|
||||||
case CO_FONTSIZE:
|
case CO_FONTSIZE:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
opt_fontsize_ = strip(lexrc.GetString());
|
opt_fontsize_ = strip(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
case CO_PAGESTYLE:
|
case CO_PAGESTYLE:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
opt_pagestyle_ = strip(lexrc.GetString());
|
opt_pagestyle_ = strip(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
case CO_OTHER:
|
case CO_OTHER:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
options_ = lexrc.GetString();
|
options_ = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case CO_END:
|
case CO_END:
|
||||||
getout = true;
|
getout = true;
|
||||||
@ -1373,32 +1373,32 @@ bool LyXTextClassList::Read ()
|
|||||||
<< real_file << endl;
|
<< real_file << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lex.IsOK()) {
|
if (!lex.isOK()) {
|
||||||
lyxerr << "LyXTextClassList::Read: unable to open "
|
lyxerr << "LyXTextClassList::Read: unable to open "
|
||||||
"textclass file `" << MakeDisplayPath(real_file, 1000)
|
"textclass file `" << MakeDisplayPath(real_file, 1000)
|
||||||
<< "'\nCheck your installation. LyX can't continue."
|
<< "'\nCheck your installation. LyX can't continue."
|
||||||
<< endl;
|
<< endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
string fname, clname, desc;
|
|
||||||
// Parse config-file
|
// Parse config-file
|
||||||
lyxerr[Debug::TCLASS] << "Starting parsing of textclass.lst" << endl;
|
lyxerr[Debug::TCLASS] << "Starting parsing of textclass.lst" << endl;
|
||||||
while (lex.IsOK() && !finished) {
|
while (lex.isOK() && !finished) {
|
||||||
lyxerr[Debug::TCLASS] << "\tline by line" << endl;
|
lyxerr[Debug::TCLASS] << "\tline by line" << endl;
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case LyXLex::LEX_FEOF:
|
case LyXLex::LEX_FEOF:
|
||||||
finished = true;
|
finished = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fname = lex.GetString();
|
string const fname = lex.getString();
|
||||||
lyxerr[Debug::TCLASS] << "Fname: " << fname << endl;
|
lyxerr[Debug::TCLASS] << "Fname: " << fname << endl;
|
||||||
if (lex.next()) {
|
if (lex.next()) {
|
||||||
clname = lex.GetString();
|
string const clname = lex.getString();
|
||||||
lyxerr[Debug::TCLASS]
|
lyxerr[Debug::TCLASS]
|
||||||
<< "Clname: " << clname << endl;
|
<< "Clname: " << clname << endl;
|
||||||
if (lex.next()) {
|
if (lex.next()) {
|
||||||
desc = lex.GetString();
|
string const desc = lex.getString();
|
||||||
lyxerr[Debug::TCLASS]
|
lyxerr[Debug::TCLASS]
|
||||||
<< "Desc: " << desc << endl;
|
<< "Desc: " << desc << endl;
|
||||||
// This code is run when we have
|
// This code is run when we have
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include "lyxcursor.h"
|
#include "lyxcursor.h"
|
||||||
|
|
||||||
|
|
||||||
LyXCursor::LyXCursor() : par_(0), pos_(0), boundary_(false),
|
LyXCursor::LyXCursor()
|
||||||
x_(0), x_fix_(0), y_(0), row_(0)
|
: par_(0), pos_(0), boundary_(false),
|
||||||
{
|
x_(0), x_fix_(0), y_(0), row_(0)
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void LyXCursor::par(Paragraph * p)
|
void LyXCursor::par(Paragraph * p)
|
||||||
@ -29,12 +29,6 @@ void LyXCursor::par(Paragraph * p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Paragraph * LyXCursor::par()
|
|
||||||
//{
|
|
||||||
// return par_;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
Paragraph * LyXCursor::par() const
|
Paragraph * LyXCursor::par() const
|
||||||
{
|
{
|
||||||
return par_;
|
return par_;
|
||||||
@ -106,12 +100,6 @@ void LyXCursor::row(Row * r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Row * LyXCursor::row()
|
|
||||||
//{
|
|
||||||
// return row_;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
Row * LyXCursor::row() const
|
Row * LyXCursor::row() const
|
||||||
{
|
{
|
||||||
return row_;
|
return row_;
|
||||||
|
@ -28,8 +28,6 @@ public:
|
|||||||
///
|
///
|
||||||
void par(Paragraph * p);
|
void par(Paragraph * p);
|
||||||
///
|
///
|
||||||
//Paragraph * par();
|
|
||||||
///
|
|
||||||
Paragraph * par() const;
|
Paragraph * par() const;
|
||||||
///
|
///
|
||||||
void pos(Paragraph::size_type p);
|
void pos(Paragraph::size_type p);
|
||||||
@ -54,8 +52,6 @@ public:
|
|||||||
///
|
///
|
||||||
void row(Row * r);
|
void row(Row * r);
|
||||||
///
|
///
|
||||||
//Row * row();
|
|
||||||
///
|
|
||||||
Row * row() const;
|
Row * row() const;
|
||||||
private:
|
private:
|
||||||
/// The paragraph the cursor is in.
|
/// The paragraph the cursor is in.
|
||||||
|
@ -650,9 +650,9 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
|
|||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
while (!finished && lex.IsOK() && !error) {
|
while (!finished && lex.isOK() && !error) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tok = lowercase(lex.GetString());
|
string const tok = lowercase(lex.getString());
|
||||||
|
|
||||||
if (tok.empty()) {
|
if (tok.empty()) {
|
||||||
continue;
|
continue;
|
||||||
@ -660,23 +660,23 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
|
|||||||
finished = true;
|
finished = true;
|
||||||
} else if (tok == "family") {
|
} else if (tok == "family") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lex.GetString();
|
string const ttok = lex.getString();
|
||||||
setLyXFamily(ttok);
|
setLyXFamily(ttok);
|
||||||
} else if (tok == "series") {
|
} else if (tok == "series") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lex.GetString();
|
string const ttok = lex.getString();
|
||||||
setLyXSeries(ttok);
|
setLyXSeries(ttok);
|
||||||
} else if (tok == "shape") {
|
} else if (tok == "shape") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lex.GetString();
|
string const ttok = lex.getString();
|
||||||
setLyXShape(ttok);
|
setLyXShape(ttok);
|
||||||
} else if (tok == "size") {
|
} else if (tok == "size") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lex.GetString();
|
string const ttok = lex.getString();
|
||||||
setLyXSize(ttok);
|
setLyXSize(ttok);
|
||||||
} else if (tok == "misc") {
|
} else if (tok == "misc") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lowercase(lex.GetString());
|
string const ttok = lowercase(lex.getString());
|
||||||
|
|
||||||
if (ttok == "no_bar") {
|
if (ttok == "no_bar") {
|
||||||
setUnderbar(OFF);
|
setUnderbar(OFF);
|
||||||
@ -695,7 +695,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
|
|||||||
}
|
}
|
||||||
} else if (tok == "color") {
|
} else if (tok == "color") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const ttok = lex.GetString();
|
string const ttok = lex.getString();
|
||||||
setLyXColor(ttok);
|
setLyXColor(ttok);
|
||||||
} else {
|
} else {
|
||||||
lex.printError("Unknown tag `$$Token'");
|
lex.printError("Unknown tag `$$Token'");
|
||||||
|
40
src/lyxlex.C
40
src/lyxlex.C
@ -39,7 +39,7 @@ LyXLex::~LyXLex()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXLex::IsOK() const
|
bool LyXLex::isOK() const
|
||||||
{
|
{
|
||||||
return pimpl_->is.good();
|
return pimpl_->is.good();
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ void LyXLex::setLineNo(int l)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LyXLex::GetLineNo() const
|
int LyXLex::getLineNo() const
|
||||||
{
|
{
|
||||||
return pimpl_->lineno;
|
return pimpl_->lineno;
|
||||||
}
|
}
|
||||||
@ -116,10 +116,10 @@ int LyXLex::lex()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LyXLex::GetInteger() const
|
int LyXLex::getInteger() const
|
||||||
{
|
{
|
||||||
if (isStrInt(pimpl_->GetString()))
|
if (isStrInt(pimpl_->getString()))
|
||||||
return strToInt(pimpl_->GetString());
|
return strToInt(pimpl_->getString());
|
||||||
else {
|
else {
|
||||||
pimpl_->printError("Bad integer `$$Token'");
|
pimpl_->printError("Bad integer `$$Token'");
|
||||||
return -1;
|
return -1;
|
||||||
@ -127,12 +127,12 @@ int LyXLex::GetInteger() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float LyXLex::GetFloat() const
|
float LyXLex::getFloat() const
|
||||||
{
|
{
|
||||||
// replace comma with dot in case the file was written with
|
// replace comma with dot in case the file was written with
|
||||||
// the wrong locale (should be rare, but is easy enough to
|
// the wrong locale (should be rare, but is easy enough to
|
||||||
// avoid).
|
// avoid).
|
||||||
string str = subst(pimpl_->GetString(), ",", ".");
|
string str = subst(pimpl_->getString(), ",", ".");
|
||||||
if (isStrDbl(str))
|
if (isStrDbl(str))
|
||||||
return strToDbl(str);
|
return strToDbl(str);
|
||||||
else {
|
else {
|
||||||
@ -142,9 +142,9 @@ float LyXLex::GetFloat() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const LyXLex::GetString() const
|
string const LyXLex::getString() const
|
||||||
{
|
{
|
||||||
return pimpl_->GetString();
|
return pimpl_->getString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,20 +156,20 @@ string const LyXLex::getLongString(string const & endtoken)
|
|||||||
string str, prefix;
|
string str, prefix;
|
||||||
bool firstline = true;
|
bool firstline = true;
|
||||||
|
|
||||||
while (IsOK()) {
|
while (isOK()) {
|
||||||
if (!EatLine())
|
if (!eatLine())
|
||||||
// blank line in the file being read
|
// blank line in the file being read
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string const token = frontStrip(strip(GetString()), " \t");
|
string const token = frontStrip(strip(getString()), " \t");
|
||||||
|
|
||||||
lyxerr[Debug::PARSER] << "LongString: `"
|
lyxerr[Debug::PARSER] << "LongString: `"
|
||||||
<< GetString() << '\'' << endl;
|
<< getString() << '\'' << endl;
|
||||||
|
|
||||||
// We do a case independent comparison, like search_kw
|
// We do a case independent comparison, like search_kw
|
||||||
// does.
|
// does.
|
||||||
if (compare_no_case(token, endtoken) != 0) {
|
if (compare_no_case(token, endtoken) != 0) {
|
||||||
string tmpstr = GetString();
|
string tmpstr = getString();
|
||||||
if (firstline) {
|
if (firstline) {
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
while(i < tmpstr.length()
|
while(i < tmpstr.length()
|
||||||
@ -191,14 +191,14 @@ string const LyXLex::getLongString(string const & endtoken)
|
|||||||
else // token == endtoken
|
else // token == endtoken
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!IsOK())
|
if (!isOK())
|
||||||
printError("Long string not ended by `" + endtoken + '\'');
|
printError("Long string not ended by `" + endtoken + '\'');
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXLex::GetBool() const
|
bool LyXLex::getBool() const
|
||||||
{
|
{
|
||||||
if (compare(pimpl_->buff, "true") == 0)
|
if (compare(pimpl_->buff, "true") == 0)
|
||||||
return true;
|
return true;
|
||||||
@ -208,9 +208,9 @@ bool LyXLex::GetBool() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXLex::EatLine()
|
bool LyXLex::eatLine()
|
||||||
{
|
{
|
||||||
return pimpl_->EatLine();
|
return pimpl_->eatLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ void LyXLex::pushToken(string const & pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LyXLex::FindToken(char const * str[])
|
int LyXLex::findToken(char const * str[])
|
||||||
{
|
{
|
||||||
int i = -1;
|
int i = -1;
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ int LyXLex::FindToken(char const * str[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int LyXLex::CheckToken(char const * str[], int print_error)
|
int LyXLex::checkToken(char const * str[], int print_error)
|
||||||
{
|
{
|
||||||
int i = -1;
|
int i = -1;
|
||||||
|
|
||||||
|
18
src/lyxlex.h
18
src/lyxlex.h
@ -49,7 +49,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// file is open and end of file is not reached
|
/// file is open and end of file is not reached
|
||||||
bool IsOK() const;
|
bool isOK() const;
|
||||||
/// return true if able to open file, else false
|
/// return true if able to open file, else false
|
||||||
bool setFile(string const & filename);
|
bool setFile(string const & filename);
|
||||||
///
|
///
|
||||||
@ -78,16 +78,16 @@ public:
|
|||||||
void pushToken(string const &);
|
void pushToken(string const &);
|
||||||
|
|
||||||
///
|
///
|
||||||
int GetLineNo() const;
|
int getLineNo() const;
|
||||||
|
|
||||||
///
|
///
|
||||||
int GetInteger() const;
|
int getInteger() const;
|
||||||
///
|
///
|
||||||
bool GetBool() const;
|
bool getBool() const;
|
||||||
///
|
///
|
||||||
float GetFloat() const;
|
float getFloat() const;
|
||||||
///
|
///
|
||||||
string const GetString() const;
|
string const getString() const;
|
||||||
|
|
||||||
/** Get a long string, ended by the tag `endtag'.
|
/** Get a long string, ended by the tag `endtag'.
|
||||||
This string can span several lines. The first line
|
This string can span several lines. The first line
|
||||||
@ -99,11 +99,11 @@ public:
|
|||||||
string const getLongString(string const & endtag);
|
string const getLongString(string const & endtag);
|
||||||
|
|
||||||
///
|
///
|
||||||
bool EatLine();
|
bool eatLine();
|
||||||
///
|
///
|
||||||
int FindToken(char const * str[]);
|
int findToken(char const * str[]);
|
||||||
///
|
///
|
||||||
int CheckToken(char const * str[], int print_error);
|
int checkToken(char const * str[], int print_error);
|
||||||
|
|
||||||
///
|
///
|
||||||
string const text() const;
|
string const text() const;
|
||||||
|
@ -40,7 +40,7 @@ LyXLex::Pimpl::Pimpl(keyword_item * tab, int num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string const LyXLex::Pimpl::GetString() const
|
string const LyXLex::Pimpl::getString() const
|
||||||
{
|
{
|
||||||
return string(buff);
|
return string(buff);
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ string const LyXLex::Pimpl::GetString() const
|
|||||||
|
|
||||||
void LyXLex::Pimpl::printError(string const & message) const
|
void LyXLex::Pimpl::printError(string const & message) const
|
||||||
{
|
{
|
||||||
string const tmpmsg = subst(message, "$$Token", GetString());
|
string const tmpmsg = subst(message, "$$Token", getString());
|
||||||
lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
|
lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
|
||||||
<< " of file " << MakeDisplayPath(name) << ']' << endl;
|
<< " of file " << MakeDisplayPath(name) << ']' << endl;
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ int LyXLex::Pimpl::lex()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXLex::Pimpl::EatLine()
|
bool LyXLex::Pimpl::eatLine()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned char c = '\0';
|
unsigned char c = '\0';
|
||||||
|
@ -24,7 +24,7 @@ struct LyXLex::Pimpl : boost::noncopyable {
|
|||||||
///
|
///
|
||||||
Pimpl(keyword_item * tab, int num);
|
Pimpl(keyword_item * tab, int num);
|
||||||
///
|
///
|
||||||
string const GetString() const;
|
string const getString() const;
|
||||||
///
|
///
|
||||||
void printError(string const & message) const;
|
void printError(string const & message) const;
|
||||||
///
|
///
|
||||||
@ -46,7 +46,7 @@ struct LyXLex::Pimpl : boost::noncopyable {
|
|||||||
///
|
///
|
||||||
int lex();
|
int lex();
|
||||||
///
|
///
|
||||||
bool EatLine();
|
bool eatLine();
|
||||||
///
|
///
|
||||||
bool nextToken();
|
bool nextToken();
|
||||||
///
|
///
|
||||||
|
224
src/lyxrc.C
224
src/lyxrc.C
@ -283,11 +283,11 @@ int LyXRC::read(string const & filename)
|
|||||||
lexrc.printTable(lyxerr);
|
lexrc.printTable(lyxerr);
|
||||||
|
|
||||||
lexrc.setFile(filename);
|
lexrc.setFile(filename);
|
||||||
if (!lexrc.IsOK()) return -2;
|
if (!lexrc.isOK()) return -2;
|
||||||
|
|
||||||
lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
|
lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
|
||||||
|
|
||||||
while (lexrc.IsOK()) {
|
while (lexrc.isOK()) {
|
||||||
// By using two switches we take advantage of the compiler
|
// By using two switches we take advantage of the compiler
|
||||||
// telling us if we have missed a LyXRCTags element in
|
// telling us if we have missed a LyXRCTags element in
|
||||||
// the second switch.
|
// the second switch.
|
||||||
@ -309,7 +309,7 @@ int LyXRC::read(string const & filename)
|
|||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const tmp =
|
string const tmp =
|
||||||
LibFileSearch(string(),
|
LibFileSearch(string(),
|
||||||
lexrc.GetString());
|
lexrc.getString());
|
||||||
if (read(tmp)) {
|
if (read(tmp)) {
|
||||||
lexrc.printError("Error reading "
|
lexrc.printError("Error reading "
|
||||||
"included file: "+tmp);
|
"included file: "+tmp);
|
||||||
@ -318,7 +318,7 @@ int LyXRC::read(string const & filename)
|
|||||||
break;
|
break;
|
||||||
case RC_BINDFILE: // RVDK_PATCH_5
|
case RC_BINDFILE: // RVDK_PATCH_5
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const tmp(lexrc.GetString());
|
string const tmp(lexrc.getString());
|
||||||
if (hasBindFile)
|
if (hasBindFile)
|
||||||
// We are already in the
|
// We are already in the
|
||||||
// "actually read bind file"
|
// "actually read bind file"
|
||||||
@ -334,28 +334,28 @@ int LyXRC::read(string const & filename)
|
|||||||
|
|
||||||
case RC_UIFILE:
|
case RC_UIFILE:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
ui_file = lexrc.GetString();
|
ui_file = lexrc.getString();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_EXIT_CONFIRMATION:
|
case RC_EXIT_CONFIRMATION:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
exit_confirmation = lexrc.GetBool();
|
exit_confirmation = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_DISPLAY_SHORTCUTS:
|
case RC_DISPLAY_SHORTCUTS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
display_shortcuts = lexrc.GetBool();
|
display_shortcuts = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_KBMAP:
|
case RC_KBMAP:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
use_kbmap = lexrc.GetBool();
|
use_kbmap = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_KBMAP_PRIMARY:
|
case RC_KBMAP_PRIMARY:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const kmap(lexrc.GetString());
|
string const kmap(lexrc.getString());
|
||||||
if (kmap.empty()) {
|
if (kmap.empty()) {
|
||||||
// nothing
|
// nothing
|
||||||
} else if (!LibFileSearch("kbd", kmap,
|
} else if (!LibFileSearch("kbd", kmap,
|
||||||
@ -368,7 +368,7 @@ int LyXRC::read(string const & filename)
|
|||||||
|
|
||||||
case RC_KBMAP_SECONDARY:
|
case RC_KBMAP_SECONDARY:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const kmap(lexrc.GetString());
|
string const kmap(lexrc.getString());
|
||||||
if (kmap.empty()) {
|
if (kmap.empty()) {
|
||||||
// nothing
|
// nothing
|
||||||
} else if (!LibFileSearch("kbd", kmap,
|
} else if (!LibFileSearch("kbd", kmap,
|
||||||
@ -381,113 +381,113 @@ int LyXRC::read(string const & filename)
|
|||||||
|
|
||||||
case RC_FONT_ENCODING:
|
case RC_FONT_ENCODING:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
fontenc = lexrc.GetString();
|
fontenc = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTER:
|
case RC_PRINTER:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
printer = lexrc.GetString();
|
printer = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINT_COMMAND:
|
case RC_PRINT_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_command = lexrc.GetString();
|
print_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTEVENPAGEFLAG:
|
case RC_PRINTEVENPAGEFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_evenpage_flag = lexrc.GetString();
|
print_evenpage_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTODDPAGEFLAG:
|
case RC_PRINTODDPAGEFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_oddpage_flag = lexrc.GetString();
|
print_oddpage_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAGERANGEFLAG:
|
case RC_PRINTPAGERANGEFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_pagerange_flag = lexrc.GetString();
|
print_pagerange_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTCOPIESFLAG:
|
case RC_PRINTCOPIESFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_copies_flag = lexrc.GetString();
|
print_copies_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTCOLLCOPIESFLAG:
|
case RC_PRINTCOLLCOPIESFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_collcopies_flag = lexrc.GetString();
|
print_collcopies_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTREVERSEFLAG:
|
case RC_PRINTREVERSEFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_reverse_flag = lexrc.GetString();
|
print_reverse_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTLANDSCAPEFLAG:
|
case RC_PRINTLANDSCAPEFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_landscape_flag = lexrc.GetString();
|
print_landscape_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTTOPRINTER:
|
case RC_PRINTTOPRINTER:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_to_printer = lexrc.GetString();
|
print_to_printer = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINT_ADAPTOUTPUT:
|
case RC_PRINT_ADAPTOUTPUT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_adapt_output = lexrc.GetBool();
|
print_adapt_output = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTTOFILE:
|
case RC_PRINTTOFILE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_to_file = lexrc.GetString();
|
print_to_file = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTFILEEXTENSION:
|
case RC_PRINTFILEEXTENSION:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_file_extension = lexrc.GetString();
|
print_file_extension = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTEXSTRAOPTIONS:
|
case RC_PRINTEXSTRAOPTIONS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_extra_options = lexrc.GetString();
|
print_extra_options = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTSPOOL_COMMAND:
|
case RC_PRINTSPOOL_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_spool_command = lexrc.GetString();
|
print_spool_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTSPOOL_PRINTERPREFIX:
|
case RC_PRINTSPOOL_PRINTERPREFIX:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_spool_printerprefix = lexrc.GetString();
|
print_spool_printerprefix = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAPERDIMENSIONFLAG:
|
case RC_PRINTPAPERDIMENSIONFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_paper_dimension_flag = lexrc.GetString();
|
print_paper_dimension_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PRINTPAPERFLAG:
|
case RC_PRINTPAPERFLAG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
print_paper_flag = lexrc.GetString();
|
print_paper_flag = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CUSTOM_EXPORT_COMMAND:
|
case RC_CUSTOM_EXPORT_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
custom_export_command = lexrc.GetString();
|
custom_export_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CUSTOM_EXPORT_FORMAT:
|
case RC_CUSTOM_EXPORT_FORMAT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
custom_export_format = lexrc.GetString();
|
custom_export_format = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_DEFAULT_PAPERSIZE:
|
case RC_DEFAULT_PAPERSIZE:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
string const size =
|
string const size =
|
||||||
lowercase(lexrc.GetString());
|
lowercase(lexrc.getString());
|
||||||
if (size == "usletter")
|
if (size == "usletter")
|
||||||
default_papersize =
|
default_papersize =
|
||||||
BufferParams::PAPER_USLETTER;
|
BufferParams::PAPER_USLETTER;
|
||||||
@ -514,150 +514,150 @@ int LyXRC::read(string const & filename)
|
|||||||
|
|
||||||
case RC_VIEWDVI_PAPEROPTION:
|
case RC_VIEWDVI_PAPEROPTION:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
view_dvi_paper_option = lexrc.GetString();
|
view_dvi_paper_option = lexrc.getString();
|
||||||
else
|
else
|
||||||
view_dvi_paper_option = "";
|
view_dvi_paper_option = "";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_PS_COMMAND:
|
case RC_PS_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
ps_command = lexrc.GetString();
|
ps_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CHKTEX_COMMAND:
|
case RC_CHKTEX_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
chktex_command = lexrc.GetString();
|
chktex_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_DPI:
|
case RC_SCREEN_DPI:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
dpi = lexrc.GetInteger();
|
dpi = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_ZOOM:
|
case RC_SCREEN_ZOOM:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
zoom = lexrc.GetInteger();
|
zoom = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_WHEEL_JUMP:
|
case RC_WHEEL_JUMP:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
wheel_jump = lexrc.GetInteger();
|
wheel_jump = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_SIZES:
|
case RC_SCREEN_FONT_SIZES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_TINY] =
|
font_sizes[LyXFont::SIZE_TINY] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_SCRIPT] =
|
font_sizes[LyXFont::SIZE_SCRIPT] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_FOOTNOTE] =
|
font_sizes[LyXFont::SIZE_FOOTNOTE] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_SMALL] =
|
font_sizes[LyXFont::SIZE_SMALL] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_NORMAL] =
|
font_sizes[LyXFont::SIZE_NORMAL] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_LARGE] =
|
font_sizes[LyXFont::SIZE_LARGE] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_LARGER] =
|
font_sizes[LyXFont::SIZE_LARGER] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_LARGEST] =
|
font_sizes[LyXFont::SIZE_LARGEST] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_HUGE] =
|
font_sizes[LyXFont::SIZE_HUGE] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_sizes[LyXFont::SIZE_HUGER] =
|
font_sizes[LyXFont::SIZE_HUGER] =
|
||||||
lexrc.GetFloat();
|
lexrc.getFloat();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_SCALABLE:
|
case RC_SCREEN_FONT_SCALABLE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
use_scalable_fonts = lexrc.GetBool();
|
use_scalable_fonts = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_AUTOSAVE:
|
case RC_AUTOSAVE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
autosave = lexrc.GetInteger();
|
autosave = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_DOCUMENTPATH:
|
case RC_DOCUMENTPATH:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
document_path = ExpandPath(lexrc.GetString());
|
document_path = ExpandPath(lexrc.getString());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_TEMPLATEPATH:
|
case RC_TEMPLATEPATH:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
template_path = ExpandPath(lexrc.GetString());
|
template_path = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_TEMPDIRPATH:
|
case RC_TEMPDIRPATH:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
tempdir_path = ExpandPath(lexrc.GetString());
|
tempdir_path = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_USETEMPDIR:
|
case RC_USETEMPDIR:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
use_tempdir = lexrc.GetBool();
|
use_tempdir = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_LASTFILES:
|
case RC_LASTFILES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
lastfiles = ExpandPath(lexrc.GetString());
|
lastfiles = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_NUMLASTFILES:
|
case RC_NUMLASTFILES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
num_lastfiles = lexrc.GetInteger();
|
num_lastfiles = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CHECKLASTFILES:
|
case RC_CHECKLASTFILES:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
check_lastfiles = lexrc.GetBool();
|
check_lastfiles = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_ROMAN:
|
case RC_SCREEN_FONT_ROMAN:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
roman_font_name = lexrc.GetString();
|
roman_font_name = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_SANS:
|
case RC_SCREEN_FONT_SANS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
sans_font_name = lexrc.GetString();
|
sans_font_name = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_TYPEWRITER:
|
case RC_SCREEN_FONT_TYPEWRITER:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
typewriter_font_name = lexrc.GetString();
|
typewriter_font_name = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_MENU:
|
case RC_SCREEN_FONT_MENU:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
menu_font_name = lexrc.GetString();
|
menu_font_name = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_POPUP:
|
case RC_SCREEN_FONT_POPUP:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
popup_font_name = lexrc.GetString();
|
popup_font_name = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_ENCODING:
|
case RC_SCREEN_FONT_ENCODING:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
font_norm = lexrc.GetString();
|
font_norm = lexrc.getString();
|
||||||
set_font_norm_type();
|
set_font_norm_type();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCREEN_FONT_ENCODING_MENU:
|
case RC_SCREEN_FONT_ENCODING_MENU:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
font_norm_menu = lexrc.GetString();
|
font_norm_menu = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SET_COLOR:
|
case RC_SET_COLOR:
|
||||||
@ -665,14 +665,14 @@ int LyXRC::read(string const & filename)
|
|||||||
string lyx_name, x11_name;
|
string lyx_name, x11_name;
|
||||||
|
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
lyx_name = lexrc.GetString();
|
lyx_name = lexrc.getString();
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("Missing color tag.");
|
lexrc.printError("Missing color tag.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
x11_name = lexrc.GetString();
|
x11_name = lexrc.getString();
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("Missing color name for color : `$$Token'");
|
lexrc.printError("Missing color name for color : `$$Token'");
|
||||||
break;
|
break;
|
||||||
@ -687,7 +687,7 @@ int LyXRC::read(string const & filename)
|
|||||||
case RC_AUTOREGIONDELETE:
|
case RC_AUTOREGIONDELETE:
|
||||||
// Auto region delete defaults to true
|
// Auto region delete defaults to true
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
auto_region_delete = lexrc.GetBool();
|
auto_region_delete = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_BIND:
|
case RC_BIND:
|
||||||
@ -702,14 +702,14 @@ int LyXRC::read(string const & filename)
|
|||||||
string seq, cmd;
|
string seq, cmd;
|
||||||
|
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
seq = lexrc.GetString();
|
seq = lexrc.getString();
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("RC_BIND: Missing key sequence");
|
lexrc.printError("RC_BIND: Missing key sequence");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lexrc.next(true)) {
|
if (lexrc.next(true)) {
|
||||||
cmd = lexrc.GetString();
|
cmd = lexrc.getString();
|
||||||
} else {
|
} else {
|
||||||
lexrc.printError("RC_BIND: missing command");
|
lexrc.printError("RC_BIND: missing command");
|
||||||
break;
|
break;
|
||||||
@ -738,145 +738,145 @@ int LyXRC::read(string const & filename)
|
|||||||
}
|
}
|
||||||
case RC_OVERRIDE_X_DEADKEYS:
|
case RC_OVERRIDE_X_DEADKEYS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
override_x_deadkeys = lexrc.GetBool();
|
override_x_deadkeys = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SERVERPIPE:
|
case RC_SERVERPIPE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
lyxpipes = ExpandPath(lexrc.GetString());
|
lyxpipes = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_CURSOR_FOLLOWS_SCROLLBAR:
|
case RC_CURSOR_FOLLOWS_SCROLLBAR:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
cursor_follows_scrollbar = lexrc.GetBool();
|
cursor_follows_scrollbar = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_ASCIIROFF_COMMAND:
|
case RC_ASCIIROFF_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
ascii_roff_command = lexrc.GetString();
|
ascii_roff_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_ASCII_LINELEN:
|
case RC_ASCII_LINELEN:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
ascii_linelen = lexrc.GetInteger();
|
ascii_linelen = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
// Spellchecker settings:
|
// Spellchecker settings:
|
||||||
#ifdef USE_PSPELL
|
#ifdef USE_PSPELL
|
||||||
case RC_USE_PSPELL:
|
case RC_USE_PSPELL:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
use_pspell = lexrc.GetBool();
|
use_pspell = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case RC_SPELL_COMMAND:
|
case RC_SPELL_COMMAND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_command = lexrc.GetString();
|
isp_command = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_ACCEPT_COMPOUND:
|
case RC_ACCEPT_COMPOUND:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_accept_compound = lexrc.GetBool();
|
isp_accept_compound = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_USE_INP_ENC:
|
case RC_USE_INP_ENC:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_use_input_encoding = lexrc.GetBool();
|
isp_use_input_encoding = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_USE_ALT_LANG:
|
case RC_USE_ALT_LANG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_use_alt_lang = lexrc.GetBool();
|
isp_use_alt_lang = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_USE_PERS_DICT:
|
case RC_USE_PERS_DICT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_use_pers_dict = lexrc.GetBool();
|
isp_use_pers_dict = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_USE_ESC_CHARS:
|
case RC_USE_ESC_CHARS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_use_esc_chars = lexrc.GetBool();
|
isp_use_esc_chars = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_ALT_LANG:
|
case RC_ALT_LANG:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_alt_lang = lexrc.GetString();
|
isp_alt_lang = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_PERS_DICT:
|
case RC_PERS_DICT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_pers_dict = lexrc.GetString();
|
isp_pers_dict = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_ESC_CHARS:
|
case RC_ESC_CHARS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
isp_esc_chars = lexrc.GetString();
|
isp_esc_chars = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_MAKE_BACKUP:
|
case RC_MAKE_BACKUP:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
make_backup = lexrc.GetBool();
|
make_backup = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_BACKUPDIR_PATH:
|
case RC_BACKUPDIR_PATH:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
backupdir_path = ExpandPath(lexrc.GetString());
|
backupdir_path = ExpandPath(lexrc.getString());
|
||||||
break;
|
break;
|
||||||
case RC_DATE_INSERT_FORMAT:
|
case RC_DATE_INSERT_FORMAT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
date_insert_format = lexrc.GetString();
|
date_insert_format = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_PACKAGE:
|
case RC_LANGUAGE_PACKAGE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_package = lexrc.GetString();
|
language_package = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_AUTO_BEGIN:
|
case RC_LANGUAGE_AUTO_BEGIN:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_auto_begin = lexrc.GetBool();
|
language_auto_begin = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_AUTO_END:
|
case RC_LANGUAGE_AUTO_END:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_auto_end = lexrc.GetBool();
|
language_auto_end = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_GLOBAL_OPTIONS:
|
case RC_LANGUAGE_GLOBAL_OPTIONS:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_global_options = lexrc.GetBool();
|
language_global_options = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_USE_BABEL:
|
case RC_LANGUAGE_USE_BABEL:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_use_babel = lexrc.GetBool();
|
language_use_babel = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_COMMAND_BEGIN:
|
case RC_LANGUAGE_COMMAND_BEGIN:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_command_begin = lexrc.GetString();
|
language_command_begin = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_COMMAND_END:
|
case RC_LANGUAGE_COMMAND_END:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_command_end = lexrc.GetString();
|
language_command_end = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_LANGUAGE_COMMAND_LOCAL:
|
case RC_LANGUAGE_COMMAND_LOCAL:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
language_command_local = lexrc.GetString();
|
language_command_local = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case RC_RTL_SUPPORT:
|
case RC_RTL_SUPPORT:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
rtl_support = lexrc.GetBool();
|
rtl_support = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_AUTO_NUMBER:
|
case RC_AUTO_NUMBER:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
auto_number = lexrc.GetBool();
|
auto_number = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_MARK_FOREIGN_LANGUAGE:
|
case RC_MARK_FOREIGN_LANGUAGE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
mark_foreign_language = lexrc.GetBool();
|
mark_foreign_language = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_SHOW_BANNER:
|
case RC_SHOW_BANNER:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
show_banner = lexrc.GetBool();
|
show_banner = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_NEW_ASK_FILENAME:
|
case RC_NEW_ASK_FILENAME:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
new_ask_filename = lexrc.GetBool();
|
new_ask_filename = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case RC_CONVERTER: {
|
case RC_CONVERTER: {
|
||||||
string from, to, command, flags;
|
string from, to, command, flags;
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
from = lexrc.GetString();
|
from = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
to = lexrc.GetString();
|
to = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
command = lexrc.GetString();
|
command = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
flags = lexrc.GetString();
|
flags = lexrc.getString();
|
||||||
if (command.empty() || command == "none")
|
if (command.empty() || command == "none")
|
||||||
converters.erase(from, to);
|
converters.erase(from, to);
|
||||||
else
|
else
|
||||||
@ -886,22 +886,22 @@ int LyXRC::read(string const & filename)
|
|||||||
case RC_VIEWER: {
|
case RC_VIEWER: {
|
||||||
string format, command;
|
string format, command;
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
format = lexrc.GetString();
|
format = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
command = lexrc.GetString();
|
command = lexrc.getString();
|
||||||
formats.setViewer(format, command);
|
formats.setViewer(format, command);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RC_FORMAT: {
|
case RC_FORMAT: {
|
||||||
string format, extension, prettyname, shortcut;
|
string format, extension, prettyname, shortcut;
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
format = lexrc.GetString();
|
format = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
extension = lexrc.GetString();
|
extension = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
prettyname = lexrc.GetString();
|
prettyname = lexrc.getString();
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
shortcut = lexrc.GetString();
|
shortcut = lexrc.getString();
|
||||||
if (prettyname.empty()) {
|
if (prettyname.empty()) {
|
||||||
if (converters.formatIsUsed(format))
|
if (converters.formatIsUsed(format))
|
||||||
lyxerr << "Can't delete format "
|
lyxerr << "Can't delete format "
|
||||||
@ -916,12 +916,12 @@ int LyXRC::read(string const & filename)
|
|||||||
}
|
}
|
||||||
case RC_DEFAULT_LANGUAGE:
|
case RC_DEFAULT_LANGUAGE:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
default_language = lexrc.GetString();
|
default_language = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_LABEL_INIT_LENGTH:
|
case RC_LABEL_INIT_LENGTH:
|
||||||
if (lexrc.next())
|
if (lexrc.next())
|
||||||
label_init_length = lexrc.GetInteger();
|
label_init_length = lexrc.getInteger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_LAST: break; // this is just a dummy
|
case RC_LAST: break; // this is just a dummy
|
||||||
|
@ -1497,9 +1497,9 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
|
|||||||
LyXFont font(LyXFont::ALL_INHERIT);
|
LyXFont font(LyXFont::ALL_INHERIT);
|
||||||
font.setLanguage(owner_->bufferOwner()->getLanguage());
|
font.setLanguage(owner_->bufferOwner()->getLanguage());
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token.empty())
|
if (token.empty())
|
||||||
continue;
|
continue;
|
||||||
if (token == "\\layout"
|
if (token == "\\layout"
|
||||||
|
15
src/text2.C
15
src/text2.C
@ -2525,20 +2525,6 @@ LyXText::text_status LyXText::status() const
|
|||||||
|
|
||||||
void LyXText::status(BufferView * bview, LyXText::text_status st) const
|
void LyXText::status(BufferView * bview, LyXText::text_status st) const
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
if ((status_ != NEED_MORE_REFRESH)
|
|
||||||
|| (status_ == NEED_MORE_REFRESH)
|
|
||||||
&& (st != NEED_VERY_LITTLE_REFRESH)) {
|
|
||||||
status_ = st;
|
|
||||||
if (inset_owner && st != UNCHANGED) {
|
|
||||||
bview->text->status(bview, NEED_VERY_LITTLE_REFRESH);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#warning Please tell what the intention is here. (Lgb)
|
|
||||||
// The above does not make any sense, I changed it to what is here,
|
|
||||||
// but it still does not make much sense. (Lgb)
|
|
||||||
#warning Sure have a look now! (Jug)
|
|
||||||
// well as much as I know && binds more then || so the above and the
|
// well as much as I know && binds more then || so the above and the
|
||||||
// below are identical (this for your known use of parentesis!)
|
// below are identical (this for your known use of parentesis!)
|
||||||
// Now some explanation:
|
// Now some explanation:
|
||||||
@ -2566,5 +2552,4 @@ void LyXText::status(BufferView * bview, LyXText::text_status st) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
12
src/trans.C
12
src/trans.C
@ -225,7 +225,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
{
|
{
|
||||||
bool error = false;
|
bool error = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !error) {
|
while (lex.isOK() && !error) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case KMOD:
|
case KMOD:
|
||||||
{
|
{
|
||||||
@ -238,7 +238,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
string const keys = lex.GetString();
|
string const keys = lex.getString();
|
||||||
|
|
||||||
if (lex.next(true)) {
|
if (lex.next(true)) {
|
||||||
if (lyxerr.debugging(Debug::KBMAP))
|
if (lyxerr.debugging(Debug::KBMAP))
|
||||||
@ -247,7 +247,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
tex_accent accent = getkeymod(lex.GetString());
|
tex_accent accent = getkeymod(lex.getString());
|
||||||
|
|
||||||
if (accent == TEX_NOACCENT)
|
if (accent == TEX_NOACCENT)
|
||||||
return -1;
|
return -1;
|
||||||
@ -263,7 +263,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
string const allowed = lex.GetString();
|
string const allowed = lex.getString();
|
||||||
AddDeadkey(accent, keys /*, allowed*/);
|
AddDeadkey(accent, keys /*, allowed*/);
|
||||||
#else
|
#else
|
||||||
AddDeadkey(accent, keys);
|
AddDeadkey(accent, keys);
|
||||||
@ -340,7 +340,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
}
|
}
|
||||||
string allowed;
|
string allowed;
|
||||||
if (lex.next()) {
|
if (lex.next()) {
|
||||||
allowed = lex.GetString();
|
allowed = lex.getString();
|
||||||
lyxerr[Debug::KBMAP] << "allowed: "
|
lyxerr[Debug::KBMAP] << "allowed: "
|
||||||
<< allowed << endl;
|
<< allowed << endl;
|
||||||
} else {
|
} else {
|
||||||
@ -388,7 +388,7 @@ int Trans::Load(LyXLex & lex)
|
|||||||
if (lyxerr.debugging(Debug::KBMAP))
|
if (lyxerr.debugging(Debug::KBMAP))
|
||||||
lyxerr << "\t`" << lex.text() << "'"
|
lyxerr << "\t`" << lex.text() << "'"
|
||||||
<< endl;
|
<< endl;
|
||||||
accent = getkeymod(lex.GetString());
|
accent = getkeymod(lex.getString());
|
||||||
} else
|
} else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user