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:
Lars Gullik Bjønnes 2001-08-06 19:12:46 +00:00
parent 8beaec704e
commit a0bf0835e5
22 changed files with 360 additions and 381 deletions

View File

@ -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>
* text.C (getVisibleRow): fix up row clearing a bit.

View File

@ -141,16 +141,16 @@ Menu & Menu::read(LyXLex & lex)
bool quit = false;
bool optional = false;
while (lex.IsOK() && !quit) {
while (lex.isOK() && !quit) {
switch (lex.lex()) {
case md_optitem:
optional = true;
// fallback to md_item
case md_item: {
lex.next(true);
string const name = _(lex.GetString());
string const name = _(lex.getString());
lex.next(true);
string const command = lex.GetString();
string const command = lex.getString();
add(MenuItem(MenuItem::Command, name,
command, optional));
optional = false;
@ -199,9 +199,9 @@ Menu & Menu::read(LyXLex & lex)
case md_submenu: {
lex.next(true);
string mlabel = _(lex.GetString());
string const mlabel = _(lex.getString());
lex.next(true);
string mname = lex.GetString();
string const mname = lex.getString();
add(MenuItem(MenuItem::Submenu, mlabel, mname));
break;
}
@ -432,9 +432,10 @@ void MenuBackend::read(LyXLex & lex)
};
//consistency check
if (compare_no_case(lex.GetString(), "menuset"))
if (compare_no_case(lex.getString(), "menuset")) {
lyxerr << "Menubackend::read: ERROR wrong token:`"
<< lex.GetString() << '\'' << endl;
<< lex.getString() << '\'' << endl;
}
lex.pushTable(menutags, md_last - 1);
if (lyxerr.debugging(Debug::PARSER))
@ -443,14 +444,14 @@ void MenuBackend::read(LyXLex & lex)
bool quit = false;
bool menubar = false;
while (lex.IsOK() && !quit) {
while (lex.isOK() && !quit) {
switch (lex.lex()) {
case md_menubar:
menubar = true;
// fallback to md_menu
case md_menu: {
lex.next(true);
string name = lex.GetString();
string const name = lex.getString();
if (hasMenu(name)) {
if (getMenu(name).menubar() == menubar) {
getMenu(name).read(lex);

View File

@ -95,13 +95,13 @@ struct keyword_item toolTags[TO_LAST - 1] = {
void ToolbarDefaults::read(LyXLex & lex)
{
//consistency check
if (compare_no_case(lex.GetString(), "toolbar"))
if (compare_no_case(lex.getString(), "toolbar")) {
lyxerr << "Toolbar::read: ERROR wrong token:`"
<< lex.GetString() << '\'' << endl;
<< lex.getString() << '\'' << endl;
}
defaults.clear();
string func;
bool quit = false;
lex.pushTable(toolTags, TO_LAST - 1);
@ -109,11 +109,11 @@ void ToolbarDefaults::read(LyXLex & lex)
if (lyxerr.debugging(Debug::PARSER))
lex.printTable(lyxerr);
while (lex.IsOK() && !quit) {
while (lex.isOK() && !quit) {
switch (lex.lex()) {
case TO_ADD:
if (lex.next(true)) {
func = lex.GetString();
string const func = lex.getString();
lyxerr[Debug::PARSER]
<< "Toolbar::read TO_ADD func: `"
<< func << "'" << endl;

View File

@ -356,7 +356,7 @@ int WorkArea::work_area_handler(FL_OBJECT * ob, int event,
<< keysym << "]" << endl;
}
#if FL_REVISION < 89
#if FL_REVISION < 89 || (FL_REVISION == 89 && FL_FIXLEVEL < 5)
if (keysym == NoSymbol) {
lyxerr[Debug::KEY]
<< "Empty kdb action (probably composing)"

View File

@ -340,9 +340,9 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
markDirty();
// We don't want to adopt the parameters from the
// document we insert, so we skip until the text begins:
while (lex.IsOK()) {
while (lex.isOK()) {
lex.nextToken();
string const pretoken = lex.GetString();
string const pretoken = lex.getString();
if (pretoken == "\\layout") {
lex.pushToken(pretoken);
break;
@ -350,9 +350,9 @@ bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
}
}
while (lex.IsOK()) {
while (lex.isOK()) {
lex.nextToken();
string const token = lex.GetString();
string const token = lex.getString();
if (token.empty()) continue;
@ -449,8 +449,8 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// Do the insetert.
insertErtContents(par, pos, font);
#endif
lex.EatLine();
string const layoutname = lex.GetString();
lex.eatLine();
string const layoutname = lex.getString();
pair<bool, LyXTextClass::LayoutList::size_type> pp
= textclasslist.NumberOfLayout(params.textclass,
layoutname);
@ -560,7 +560,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// This is the compability reader. It can be removed in
// LyX version 1.3.0. (Lgb)
lex.next();
string const tmptok = lex.GetString();
string const tmptok = lex.getString();
//lyxerr << "old float: " << tmptok << endl;
Inset * inset = 0;
@ -612,7 +612,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// This _is_ a hack! (Lgb)
while (true) {
lex.next();
string const tmp = lex.GetString();
string const tmp = lex.getString();
if (tmp == "\\end_deeper") {
//lyxerr << "\\end_deeper caught!" << endl;
if (!depth) {
@ -652,15 +652,15 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
} else if (token == "\\begin_preamble") {
params.readPreamble(lex);
} else if (token == "\\textclass") {
lex.EatLine();
lex.eatLine();
pair<bool, LyXTextClassList::size_type> pp =
textclasslist.NumberOfClass(lex.GetString());
textclasslist.NumberOfClass(lex.getString());
if (pp.first) {
params.textclass = pp.second;
} else {
WriteAlert(string(_("Textclass error")),
string(_("The document uses an unknown textclass \"")) +
lex.GetString() + string("\"."),
lex.getString() + string("\"."),
string(_("LyX will not be able to produce output correctly.")));
params.textclass = 0;
}
@ -677,20 +677,20 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
params.textclass = 0;
}
} else if (token == "\\options") {
lex.EatLine();
params.options = lex.GetString();
lex.eatLine();
params.options = lex.getString();
} else if (token == "\\language") {
params.readLanguage(lex);
} else if (token == "\\fontencoding") {
lex.EatLine();
lex.eatLine();
} else if (token == "\\inputencoding") {
lex.EatLine();
params.inputenc = lex.GetString();
lex.eatLine();
params.inputenc = lex.getString();
} else if (token == "\\graphics") {
params.readGraphicsDriver(lex);
} else if (token == "\\fontscheme") {
lex.EatLine();
params.fonts = lex.GetString();
lex.eatLine();
params.fonts = lex.getString();
} else if (token == "\\noindent") {
par->params().noindent(true);
} else if (token == "\\fill_top") {
@ -708,21 +708,21 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
} else if (token == "\\start_of_appendix") {
par->params().startOfAppendix(true);
} 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 != LYX_LAYOUT_DEFAULT)
params.paragraph_separation =
static_cast<BufferParams::PARSEP>(tmpret);
} else if (token == "\\defskip") {
lex.nextToken();
params.defskip = VSpace(lex.GetString());
params.defskip = VSpace(lex.getString());
} else if (token == "\\epsfig") { // obsolete
// Indeed it is obsolete, but we HAVE to be backwards
// compatible until 0.14, because otherwise all figures
// in existing documents are irretrivably lost. (Asger)
params.readGraphicsDriver(lex);
} 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 != LYX_LAYOUT_DEFAULT) {
InsetQuotes::quote_language tmpl =
@ -751,7 +751,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
}
} else if (token == "\\quotes_times") {
lex.nextToken();
switch (lex.GetInteger()) {
switch (lex.getInteger()) {
case 1:
params.quotes_times = InsetQuotes::SingleQ;
break;
@ -760,13 +760,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
break;
}
} else if (token == "\\papersize") {
int tmpret = lex.FindToken(string_papersize);
int tmpret = lex.findToken(string_papersize);
if (tmpret == -1)
++tmpret;
else
params.papersize2 = tmpret;
} else if (token == "\\paperpackage") {
int tmpret = lex.FindToken(string_paperpackages);
int tmpret = lex.findToken(string_paperpackages);
if (tmpret == -1) {
++tmpret;
params.paperpackage = BufferParams::PACKAGE_NONE;
@ -774,81 +774,81 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
params.paperpackage = tmpret;
} else if (token == "\\use_geometry") {
lex.nextToken();
params.use_geometry = lex.GetInteger();
params.use_geometry = lex.getInteger();
} else if (token == "\\use_amsmath") {
lex.nextToken();
params.use_amsmath = lex.GetInteger();
params.use_amsmath = lex.getInteger();
} else if (token == "\\use_natbib") {
lex.nextToken();
params.use_natbib = lex.GetInteger();
params.use_natbib = lex.getInteger();
} else if (token == "\\use_numerical_citations") {
lex.nextToken();
params.use_numerical_citations = lex.GetInteger();
params.use_numerical_citations = lex.getInteger();
} else if (token == "\\paperorientation") {
int tmpret = lex.FindToken(string_orientation);
int tmpret = lex.findToken(string_orientation);
if (tmpret == -1) ++tmpret;
if (tmpret != LYX_LAYOUT_DEFAULT)
params.orientation = static_cast<BufferParams::PAPER_ORIENTATION>(tmpret);
} else if (token == "\\paperwidth") {
lex.next();
params.paperwidth = lex.GetString();
params.paperwidth = lex.getString();
} else if (token == "\\paperheight") {
lex.next();
params.paperheight = lex.GetString();
params.paperheight = lex.getString();
} else if (token == "\\leftmargin") {
lex.next();
params.leftmargin = lex.GetString();
params.leftmargin = lex.getString();
} else if (token == "\\topmargin") {
lex.next();
params.topmargin = lex.GetString();
params.topmargin = lex.getString();
} else if (token == "\\rightmargin") {
lex.next();
params.rightmargin = lex.GetString();
params.rightmargin = lex.getString();
} else if (token == "\\bottommargin") {
lex.next();
params.bottommargin = lex.GetString();
params.bottommargin = lex.getString();
} else if (token == "\\headheight") {
lex.next();
params.headheight = lex.GetString();
params.headheight = lex.getString();
} else if (token == "\\headsep") {
lex.next();
params.headsep = lex.GetString();
params.headsep = lex.getString();
} else if (token == "\\footskip") {
lex.next();
params.footskip = lex.GetString();
params.footskip = lex.getString();
} else if (token == "\\paperfontsize") {
lex.nextToken();
params.fontsize = strip(lex.GetString());
params.fontsize = strip(lex.getString());
} else if (token == "\\papercolumns") {
lex.nextToken();
params.columns = lex.GetInteger();
params.columns = lex.getInteger();
} else if (token == "\\papersides") {
lex.nextToken();
switch (lex.GetInteger()) {
switch (lex.getInteger()) {
default:
case 1: params.sides = LyXTextClass::OneSide; break;
case 2: params.sides = LyXTextClass::TwoSides; break;
}
} else if (token == "\\paperpagestyle") {
lex.nextToken();
params.pagestyle = strip(lex.GetString());
params.pagestyle = strip(lex.getString());
} else if (token == "\\bullet") {
lex.nextToken();
int const index = lex.GetInteger();
int const index = lex.getInteger();
lex.nextToken();
int temp_int = lex.GetInteger();
int temp_int = lex.getInteger();
params.user_defined_bullets[index].setFont(temp_int);
params.temp_bullets[index].setFont(temp_int);
lex.nextToken();
temp_int = lex.GetInteger();
temp_int = lex.getInteger();
params.user_defined_bullets[index].setCharacter(temp_int);
params.temp_bullets[index].setCharacter(temp_int);
lex.nextToken();
temp_int = lex.GetInteger();
temp_int = lex.getInteger();
params.user_defined_bullets[index].setSize(temp_int);
params.temp_bullets[index].setSize(temp_int);
lex.nextToken();
string const temp_str = lex.GetString();
string const temp_str = lex.getString();
if (temp_str != "\\end_bullet") {
// this element isn't really necessary for
// parsing but is easier for humans
@ -859,9 +859,9 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
}
} else if (token == "\\bulletLaTeX") {
lex.nextToken();
int const index = lex.GetInteger();
int const index = lex.getInteger();
lex.next();
string temp_str = lex.GetString();
string temp_str = lex.getString();
string sum_str;
while (temp_str != "\\end_bullet") {
// this loop structure is needed when user
@ -872,19 +872,19 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
// therefore needs to be read in turn
sum_str += temp_str;
lex.next();
temp_str = lex.GetString();
temp_str = lex.getString();
}
params.user_defined_bullets[index].setText(sum_str);
params.temp_bullets[index].setText(sum_str);
} else if (token == "\\secnumdepth") {
lex.nextToken();
params.secnumdepth = lex.GetInteger();
params.secnumdepth = lex.getInteger();
} else if (token == "\\tocdepth") {
lex.nextToken();
params.tocdepth = lex.GetInteger();
params.tocdepth = lex.getInteger();
} else if (token == "\\spacing") {
lex.next();
string const tmp = strip(lex.GetString());
string const tmp = strip(lex.getString());
Spacing::Space tmp_space = Spacing::Default;
float tmp_val = 0.0;
if (tmp == "single") {
@ -896,7 +896,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
} else if (tmp == "other") {
lex.next();
tmp_space = Spacing::Other;
tmp_val = lex.GetFloat();
tmp_val = lex.getFloat();
} else {
lex.printError("Unknown spacing token: '$$Token'");
}
@ -909,7 +909,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
}
} else if (token == "\\paragraph_spacing") {
lex.next();
string const tmp = strip(lex.GetString());
string const tmp = strip(lex.getString());
if (tmp == "single") {
par->params().spacing(Spacing(Spacing::Single));
} else if (tmp == "onehalf") {
@ -919,29 +919,29 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
} else if (tmp == "other") {
lex.next();
par->params().spacing(Spacing(Spacing::Other,
lex.GetFloat()));
lex.getFloat()));
} else {
lex.printError("Unknown spacing token: '$$Token'");
}
} else if (token == "\\float_placement") {
lex.nextToken();
params.float_placement = lex.GetString();
params.float_placement = lex.getString();
} else if (token == "\\family") {
lex.next();
font.setLyXFamily(lex.GetString());
font.setLyXFamily(lex.getString());
} else if (token == "\\series") {
lex.next();
font.setLyXSeries(lex.GetString());
font.setLyXSeries(lex.getString());
} else if (token == "\\shape") {
lex.next();
font.setLyXShape(lex.GetString());
font.setLyXShape(lex.getString());
} else if (token == "\\size") {
lex.next();
font.setLyXSize(lex.GetString());
font.setLyXSize(lex.getString());
#ifndef NO_COMPABILITY
} else if (token == "\\latex") {
lex.next();
string const tok = lex.GetString();
string const tok = lex.getString();
if (tok == "no_latex") {
// Do the insetert.
insertErtContents(par, pos, font);
@ -957,7 +957,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
#endif
} else if (token == "\\lang") {
lex.next();
string const tok = lex.GetString();
string const tok = lex.getString();
Language const * lang = languages.getLanguage(tok);
if (lang) {
font.setLanguage(lang);
@ -967,13 +967,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
}
} else if (token == "\\numeric") {
lex.next();
font.setNumber(font.setLyXMisc(lex.GetString()));
font.setNumber(font.setLyXMisc(lex.getString()));
} else if (token == "\\emph") {
lex.next();
font.setEmph(font.setLyXMisc(lex.GetString()));
font.setEmph(font.setLyXMisc(lex.getString()));
} else if (token == "\\bar") {
lex.next();
string const tok = lex.GetString();
string const tok = lex.getString();
// This is dirty, but gone with LyX3. (Asger)
if (tok == "under")
font.setUnderbar(LyXFont::ON);
@ -986,12 +986,12 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
"`$$Token'");
} else if (token == "\\noun") {
lex.next();
font.setNoun(font.setLyXMisc(lex.GetString()));
font.setNoun(font.setLyXMisc(lex.getString()));
} else if (token == "\\color") {
lex.next();
font.setLyXColor(lex.GetString());
font.setLyXColor(lex.getString());
} else if (token == "\\align") {
int tmpret = lex.FindToken(string_align);
int tmpret = lex.findToken(string_align);
if (tmpret == -1) ++tmpret;
if (tmpret != LYX_LAYOUT_DEFAULT) { // tmpret != 99 ???
int const tmpret2 = int(pow(2.0, tmpret));
@ -1000,35 +1000,35 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
}
} else if (token == "\\added_space_top") {
lex.nextToken();
par->params().spaceTop(VSpace(lex.GetString()));
par->params().spaceTop(VSpace(lex.getString()));
} else if (token == "\\added_space_bottom") {
lex.nextToken();
par->params().spaceBottom(VSpace(lex.GetString()));
par->params().spaceBottom(VSpace(lex.getString()));
#ifndef NO_COMPABILITY
#ifndef NO_PEXTRA_REALLY
} else if (token == "\\pextra_type") {
lex.nextToken();
par->params().pextraType(lex.GetInteger());
par->params().pextraType(lex.getInteger());
} else if (token == "\\pextra_width") {
lex.nextToken();
par->params().pextraWidth(lex.GetString());
par->params().pextraWidth(lex.getString());
} else if (token == "\\pextra_widthp") {
lex.nextToken();
par->params().pextraWidthp(lex.GetString());
par->params().pextraWidthp(lex.getString());
} else if (token == "\\pextra_alignment") {
lex.nextToken();
par->params().pextraAlignment(lex.GetInteger());
par->params().pextraAlignment(lex.getInteger());
} else if (token == "\\pextra_hfill") {
lex.nextToken();
par->params().pextraHfill(lex.GetInteger());
par->params().pextraHfill(lex.getInteger());
} else if (token == "\\pextra_start_minipage") {
lex.nextToken();
par->params().pextraStartMinipage(lex.GetInteger());
par->params().pextraStartMinipage(lex.getInteger());
#endif
#endif
} else if (token == "\\labelwidthstring") {
lex.EatLine();
par->params().labelWidthString(lex.GetString());
lex.eatLine();
par->params().labelWidthString(lex.getString());
// do not delete this token, it is still needed!
} else if (token == "\\end_inset") {
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
if (layout.free_spacing) {
if (lex.IsOK()) {
if (lex.isOK()) {
lex.next();
string next_token = lex.GetString();
string next_token = lex.getString();
if (next_token == "\\-") {
par->insertChar(pos, '-', font);
} else if (next_token == "\\protected_separator"
@ -1386,7 +1386,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
int & pos, LyXFont & font)
{
// consistency check
if (lex.GetString() != "\\begin_inset") {
if (lex.getString() != "\\begin_inset") {
lyxerr << "Buffer::readInset: Consistency check failed."
<< endl;
}
@ -1394,7 +1394,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
Inset * inset = 0;
lex.next();
string const tmptok = lex.GetString();
string const tmptok = lex.getString();
last_inset_read = tmptok;
// test the different insets
@ -1483,7 +1483,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
inset = new InsetMinipage;
} else if (tmptok == "Float") {
lex.next();
string tmptok = lex.GetString();
string tmptok = lex.getString();
inset = new InsetFloat(tmptok);
#if 0
} else if (tmptok == "List") {
@ -1509,12 +1509,12 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par,
bool Buffer::readFile(LyXLex & lex, Paragraph * par)
{
if (lex.IsOK()) {
if (lex.isOK()) {
lex.next();
string const token(lex.GetString());
string const token(lex.getString());
if (token == "\\lyxformat") { // the first token _must_ be...
lex.EatLine();
string tmp_format = lex.GetString();
lex.eatLine();
string tmp_format = lex.getString();
//lyxerr << "LyX Format: `" << tmp_format << "'" << endl;
// if present remove ".," from string.
string::size_type dot = tmp_format.find_first_of(".,");

View File

@ -449,7 +449,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
bool templateok = false;
LyXLex lex(0, 0);
lex.setFile(tname);
if (lex.IsOK()) {
if (lex.isOK()) {
if (b->readFile(lex)) {
templateok = true;
}

View File

@ -191,7 +191,7 @@ void BufferParams::useClassDefaults() {
void BufferParams::readPreamble(LyXLex & lex)
{
if (lex.GetString() != "\\begin_preamble")
if (lex.getString() != "\\begin_preamble")
lyxerr << "Error (BufferParams::readPreamble):"
"consistency check failed." << endl;
@ -203,7 +203,7 @@ void BufferParams::readLanguage(LyXLex & lex)
{
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
language = languages.getLanguage(tmptok);
@ -221,7 +221,7 @@ void BufferParams::readGraphicsDriver(LyXLex & lex)
{
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
int n = 0;
while (true) {

View File

@ -282,7 +282,6 @@ private:
};
#warning why is a pointer returned and not a const reference? (Lgb)
Converter const * Converters::getConverter(string const & from,
string const & to)
{

View File

@ -308,19 +308,19 @@ void Encodings::read(string const & filename)
LyXLex lex(encodingtags, et_last - 1);
lex.setFile(filename);
while (lex.IsOK()) {
while (lex.isOK()) {
switch (lex.lex()) {
case et_encoding:
{
lex.next();
string name = lex.GetString();
string const name = lex.getString();
lex.next();
string latexname = lex.GetString();
string const latexname = lex.getString();
lyxerr[Debug::INIT] << "Reading encoding " << name << endl;
Uchar table[256];
for (unsigned int i = 0; i < 256; ++i) {
lex.next();
string tmp = lex.GetString();
string const tmp = lex.getString();
table[i] = ::strtol(tmp.c_str(), 0 , 16);
}
encodinglist[name] = Encoding(name, latexname, table);

View File

@ -45,28 +45,33 @@ void Languages::read(string const & filename)
{
LyXLex lex(0, 0);
lex.setFile(filename);
while (lex.IsOK()) {
string lang, babel, display, encoding_str, code, latex_options;
while (lex.isOK()) {
string lang;
string babel;
string display;
string encoding_str;
string code;
string latex_options;
bool rtl = false;
if (lex.next())
lang = lex.GetString();
lang = lex.getString();
else
break;
lyxerr[Debug::INIT] << "Reading language " << lang << endl;
if (lex.next())
babel = lex.GetString();
babel = lex.getString();
if (lex.next())
display = lex.GetString();
display = lex.getString();
if (lex.next())
rtl = lex.GetBool();
rtl = lex.getBool();
if (lex.next())
encoding_str = lex.GetString();
encoding_str = lex.getString();
if (lex.next())
code = lex.GetString();
code = lex.getString();
if (lex.next())
latex_options = lex.GetString();
latex_options = lex.getString();
Encoding const * encoding = encodings.getEncoding(encoding_str);
if (!encoding) {

View File

@ -189,7 +189,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
bool finished = false;
lexrc.pushTable(layoutTags, LT_INTITLE);
// parse style section
while (!finished && lexrc.IsOK() && !error) {
while (!finished && lexrc.isOK() && !error) {
int le = lexrc.lex();
// See comment in lyxrc.C.
switch (le) {
@ -209,9 +209,9 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
case LT_COPYSTYLE: // initialize with a known style
if (lexrc.next()) {
if (tclass.hasLayout(lexrc.GetString())) {
string tmpname = name_;
this->operator= (tclass.GetLayout(lexrc.GetString()));
if (tclass.hasLayout(lexrc.getString())) {
string const tmpname = name_;
this->operator= (tclass.GetLayout(lexrc.getString()));
name_ = tmpname;
} else {
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
if (lexrc.next()) {
if (tclass.hasLayout(lexrc.GetString())) {
string tmpname = name_;
this->operator= (tclass.GetLayout(lexrc.GetString()));
if (tclass.hasLayout(lexrc.getString())) {
string const tmpname = name_;
this->operator= (tclass.GetLayout(lexrc.getString()));
name_ = tmpname;
if (obsoleted_by().empty())
obsoleted_by_ = lexrc.GetString();
obsoleted_by_ = lexrc.getString();
} else {
lexrc.printError("Cannot replace with"
" unknown style "
@ -245,15 +245,15 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
break;
case LT_INTITLE:
intitle = lexrc.next() && lexrc.GetInteger();
intitle = lexrc.next() && lexrc.getInteger();
break;
case LT_NEED_PROTECT:
needprotect = lexrc.next() && lexrc.GetInteger();
needprotect = lexrc.next() && lexrc.getInteger();
break;
case LT_KEEPEMPTY:
keepempty = lexrc.next() && lexrc.GetInteger();
keepempty = lexrc.next() && lexrc.getInteger();
break;
case LT_FONT:
@ -270,7 +270,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
break;
case LT_NEXTNOINDENT: // Indent next paragraph?
if (lexrc.next() && lexrc.GetInteger())
if (lexrc.next() && lexrc.getInteger())
nextnoindent = true;
else
nextnoindent = false;
@ -278,12 +278,12 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
case LT_LATEXNAME:
if (lexrc.next())
latexname_ = lexrc.GetString();
latexname_ = lexrc.getString();
break;
case LT_LATEXPARAM:
if (lexrc.next())
latexparam_ = lexrc.GetString();
latexparam_ = lexrc.getString();
break;
case LT_PREAMBLE:
@ -300,73 +300,73 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
case LT_LEFTMARGIN: // left margin type
if (lexrc.next())
leftmargin = lexrc.GetString();
leftmargin = lexrc.getString();
break;
case LT_RIGHTMARGIN: // right margin type
if (lexrc.next())
rightmargin = lexrc.GetString();
rightmargin = lexrc.getString();
break;
case LT_LABELINDENT: // label indenting flag
if (lexrc.next())
labelindent = lexrc.GetString();
labelindent = lexrc.getString();
break;
case LT_PARINDENT: // paragraph indent. flag
if (lexrc.next())
parindent = lexrc.GetString();
parindent = lexrc.getString();
break;
case LT_PARSKIP: // paragraph skip size
if (lexrc.next())
parskip = lexrc.GetFloat();
parskip = lexrc.getFloat();
break;
case LT_ITEMSEP: // item separation size
if (lexrc.next())
itemsep = lexrc.GetFloat();
itemsep = lexrc.getFloat();
break;
case LT_TOPSEP: // top separation size
if (lexrc.next())
topsep = lexrc.GetFloat();
topsep = lexrc.getFloat();
break;
case LT_BOTTOMSEP: // bottom separation size
if (lexrc.next())
bottomsep = lexrc.GetFloat();
bottomsep = lexrc.getFloat();
break;
case LT_LABEL_BOTTOMSEP: // label bottom separation size
if (lexrc.next())
labelbottomsep = lexrc.GetFloat();
labelbottomsep = lexrc.getFloat();
break;
case LT_LABELSEP: // label separator
if (lexrc.next()) {
labelsep = subst(lexrc.GetString(), 'x', ' ');
labelsep = subst(lexrc.getString(), 'x', ' ');
}
break;
case LT_PARSEP: // par. separation size
if (lexrc.next())
parsep = lexrc.GetFloat();
parsep = lexrc.getFloat();
break;
case LT_FILL_TOP: // fill top flag
if (lexrc.next())
fill_top = lexrc.GetInteger();
fill_top = lexrc.getInteger();
break;
case LT_FILL_BOTTOM: // fill bottom flag
if (lexrc.next())
fill_bottom = lexrc.GetInteger();
fill_bottom = lexrc.getInteger();
break;
case LT_NEWLINE: // newlines allowed?
if (lexrc.next())
newline_allowed = lexrc.GetInteger();
newline_allowed = lexrc.getInteger();
break;
case LT_ALIGN: // paragraph align
@ -378,27 +378,27 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
case LT_LABELSTRING: // label string definition
if (lexrc.next())
labelstring_ = lexrc.GetString();
labelstring_ = lexrc.getString();
break;
case LT_ENDLABELSTRING: // endlabel string definition
if (lexrc.next())
endlabelstring_ = lexrc.GetString();
endlabelstring_ = lexrc.getString();
break;
case LT_LABELSTRING_APPENDIX: // label string appendix definition
if (lexrc.next())
labelstring_appendix_ = lexrc.GetString();
labelstring_appendix_ = lexrc.getString();
break;
case LT_FREE_SPACING: // Allow for free spacing.
if (lexrc.next())
free_spacing = lexrc.GetInteger();
free_spacing = lexrc.getInteger();
break;
case LT_PASS_THRU: // Allow for pass thru.
if (lexrc.next())
pass_thru = lexrc.GetInteger();
pass_thru = lexrc.getInteger();
break;
case LT_SPACING: // setspace.sty
@ -470,7 +470,7 @@ void LyXLayout::readAlignPossible(LyXLex & lexrc)
lexrc.pushTable(alignTags, AT_LAYOUT);
alignpossible = LYX_ALIGN_NONE;
int lineno = lexrc.GetLineNo();
int lineno = lexrc.getLineNo();
do {
int le = lexrc.lex();
switch (le) {
@ -496,7 +496,7 @@ void LyXLayout::readAlignPossible(LyXLex & lexrc)
alignpossible |= LYX_ALIGN_LAYOUT;
break;
}
} while (lineno == lexrc.GetLineNo());
} while (lineno == lexrc.getLineNo());
lexrc.popTable();
}
@ -743,7 +743,7 @@ void LyXLayout::readSpacing(LyXLex & lexrc)
break;
case ST_OTHER:
lexrc.next();
spacing.set(Spacing::Other, lexrc.GetFloat());
spacing.set(Spacing::Other, lexrc.getFloat());
break;
}
}
@ -845,10 +845,10 @@ bool LyXTextClass::Read(string const & filename, bool merge)
bool error = false;
lexrc.setFile(filename);
if (!lexrc.IsOK()) error = true;
if (!lexrc.isOK()) error = true;
// parsing
while (lexrc.IsOK() && !error) {
while (lexrc.isOK() && !error) {
int le = lexrc.lex();
switch (le) {
case LyXLex::LEX_FEOF:
@ -868,7 +868,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_INPUT: // Include file
if (lexrc.next()) {
string tmp = LibFileSearch("layouts",
lexrc.GetString(),
lexrc.getString(),
"layout");
if (Read(tmp, true)) {
@ -881,7 +881,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_STYLE:
if (lexrc.next()) {
string name = subst(lexrc.GetString(),
string name = subst(lexrc.getString(),
'_', ' ');
if (hasLayout(name)) {
LyXLayout & lay = GetLayout(name);
@ -901,7 +901,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_NOSTYLE:
if (lexrc.next()) {
string style = subst(lexrc.GetString(),
string const style = subst(lexrc.getString(),
'_', ' ');
if (!delete_layout(style))
lexrc.printError("Cannot delete style"
@ -911,12 +911,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_COLUMNS:
if (lexrc.next())
columns_ = lexrc.GetInteger();
columns_ = lexrc.getInteger();
break;
case TC_SIDES:
if (lexrc.next()) {
switch (lexrc.GetInteger()) {
switch (lexrc.getInteger()) {
case 1: sides_ = OneSide; break;
case 2: sides_ = TwoSides; break;
default:
@ -931,7 +931,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_PAGESTYLE:
lexrc.next();
pagestyle_ = strip(lexrc.GetString());
pagestyle_ = strip(lexrc.getString());
break;
case TC_DEFAULTFONT:
@ -950,12 +950,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
case TC_SECNUMDEPTH:
lexrc.next();
secnumdepth_ = lexrc.GetInteger();
secnumdepth_ = lexrc.getInteger();
break;
case TC_TOCDEPTH:
lexrc.next();
tocdepth_ = lexrc.GetInteger();
tocdepth_ = lexrc.getInteger();
break;
// First step to support options
@ -968,28 +968,28 @@ bool LyXTextClass::Read(string const & filename, bool merge)
break;
case TC_PROVIDESAMSMATH:
if (lexrc.next() && lexrc.GetInteger())
if (lexrc.next() && lexrc.getInteger())
provides_ |= amsmath;
break;
case TC_PROVIDESMAKEIDX:
if (lexrc.next() && lexrc.GetInteger())
if (lexrc.next() && lexrc.getInteger())
provides_ |= makeidx;
break;
case TC_PROVIDESURL:
if (lexrc.next() && lexrc.GetInteger())
if (lexrc.next() && lexrc.getInteger())
provides_ = url;
break;
case TC_LEFTMARGIN: // left margin type
if (lexrc.next())
leftmargin_ = lexrc.GetString();
leftmargin_ = lexrc.getString();
break;
case TC_RIGHTMARGIN: // right margin type
if (lexrc.next())
rightmargin_ = lexrc.GetString();
rightmargin_ = lexrc.getString();
break;
}
}
@ -1129,7 +1129,7 @@ void LyXTextClass::readClassOptions(LyXLex & lexrc)
lexrc.pushTable(classOptionsTags, CO_END);
bool getout = false;
while (!getout && lexrc.IsOK()) {
while (!getout && lexrc.isOK()) {
int le = lexrc.lex();
switch (le) {
case LyXLex::LEX_UNDEF:
@ -1140,15 +1140,15 @@ void LyXTextClass::readClassOptions(LyXLex & lexrc)
switch (static_cast<ClassOptionsTags>(le)) {
case CO_FONTSIZE:
lexrc.next();
opt_fontsize_ = strip(lexrc.GetString());
opt_fontsize_ = strip(lexrc.getString());
break;
case CO_PAGESTYLE:
lexrc.next();
opt_pagestyle_ = strip(lexrc.GetString());
opt_pagestyle_ = strip(lexrc.getString());
break;
case CO_OTHER:
lexrc.next();
options_ = lexrc.GetString();
options_ = lexrc.getString();
break;
case CO_END:
getout = true;
@ -1373,32 +1373,32 @@ bool LyXTextClassList::Read ()
<< real_file << endl;
}
if (!lex.IsOK()) {
if (!lex.isOK()) {
lyxerr << "LyXTextClassList::Read: unable to open "
"textclass file `" << MakeDisplayPath(real_file, 1000)
<< "'\nCheck your installation. LyX can't continue."
<< endl;
return false;
}
bool finished = false;
string fname, clname, desc;
// Parse config-file
lyxerr[Debug::TCLASS] << "Starting parsing of textclass.lst" << endl;
while (lex.IsOK() && !finished) {
while (lex.isOK() && !finished) {
lyxerr[Debug::TCLASS] << "\tline by line" << endl;
switch (lex.lex()) {
case LyXLex::LEX_FEOF:
finished = true;
break;
default:
fname = lex.GetString();
string const fname = lex.getString();
lyxerr[Debug::TCLASS] << "Fname: " << fname << endl;
if (lex.next()) {
clname = lex.GetString();
string const clname = lex.getString();
lyxerr[Debug::TCLASS]
<< "Clname: " << clname << endl;
if (lex.next()) {
desc = lex.GetString();
string const desc = lex.getString();
lyxerr[Debug::TCLASS]
<< "Desc: " << desc << endl;
// This code is run when we have

View File

@ -17,10 +17,10 @@
#include "lyxcursor.h"
LyXCursor::LyXCursor() : par_(0), pos_(0), boundary_(false),
LyXCursor::LyXCursor()
: par_(0), pos_(0), boundary_(false),
x_(0), x_fix_(0), y_(0), row_(0)
{
}
{}
void LyXCursor::par(Paragraph * p)
@ -29,12 +29,6 @@ void LyXCursor::par(Paragraph * p)
}
//Paragraph * LyXCursor::par()
//{
// return par_;
//}
Paragraph * LyXCursor::par() const
{
return par_;
@ -106,12 +100,6 @@ void LyXCursor::row(Row * r)
}
//Row * LyXCursor::row()
//{
// return row_;
//}
Row * LyXCursor::row() const
{
return row_;

View File

@ -28,8 +28,6 @@ public:
///
void par(Paragraph * p);
///
//Paragraph * par();
///
Paragraph * par() const;
///
void pos(Paragraph::size_type p);
@ -54,8 +52,6 @@ public:
///
void row(Row * r);
///
//Row * row();
///
Row * row() const;
private:
/// The paragraph the cursor is in.

View File

@ -650,9 +650,9 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
{
bool error = false;
bool finished = false;
while (!finished && lex.IsOK() && !error) {
while (!finished && lex.isOK() && !error) {
lex.next();
string const tok = lowercase(lex.GetString());
string const tok = lowercase(lex.getString());
if (tok.empty()) {
continue;
@ -660,23 +660,23 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
finished = true;
} else if (tok == "family") {
lex.next();
string const ttok = lex.GetString();
string const ttok = lex.getString();
setLyXFamily(ttok);
} else if (tok == "series") {
lex.next();
string const ttok = lex.GetString();
string const ttok = lex.getString();
setLyXSeries(ttok);
} else if (tok == "shape") {
lex.next();
string const ttok = lex.GetString();
string const ttok = lex.getString();
setLyXShape(ttok);
} else if (tok == "size") {
lex.next();
string const ttok = lex.GetString();
string const ttok = lex.getString();
setLyXSize(ttok);
} else if (tok == "misc") {
lex.next();
string const ttok = lowercase(lex.GetString());
string const ttok = lowercase(lex.getString());
if (ttok == "no_bar") {
setUnderbar(OFF);
@ -695,7 +695,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
}
} else if (tok == "color") {
lex.next();
string const ttok = lex.GetString();
string const ttok = lex.getString();
setLyXColor(ttok);
} else {
lex.printError("Unknown tag `$$Token'");

View File

@ -39,7 +39,7 @@ LyXLex::~LyXLex()
}
bool LyXLex::IsOK() const
bool LyXLex::isOK() const
{
return pimpl_->is.good();
}
@ -51,7 +51,7 @@ void LyXLex::setLineNo(int l)
}
int LyXLex::GetLineNo() const
int LyXLex::getLineNo() const
{
return pimpl_->lineno;
}
@ -116,10 +116,10 @@ int LyXLex::lex()
}
int LyXLex::GetInteger() const
int LyXLex::getInteger() const
{
if (isStrInt(pimpl_->GetString()))
return strToInt(pimpl_->GetString());
if (isStrInt(pimpl_->getString()))
return strToInt(pimpl_->getString());
else {
pimpl_->printError("Bad integer `$$Token'");
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
// the wrong locale (should be rare, but is easy enough to
// avoid).
string str = subst(pimpl_->GetString(), ",", ".");
string str = subst(pimpl_->getString(), ",", ".");
if (isStrDbl(str))
return strToDbl(str);
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;
bool firstline = true;
while (IsOK()) {
if (!EatLine())
while (isOK()) {
if (!eatLine())
// blank line in the file being read
continue;
string const token = frontStrip(strip(GetString()), " \t");
string const token = frontStrip(strip(getString()), " \t");
lyxerr[Debug::PARSER] << "LongString: `"
<< GetString() << '\'' << endl;
<< getString() << '\'' << endl;
// We do a case independent comparison, like search_kw
// does.
if (compare_no_case(token, endtoken) != 0) {
string tmpstr = GetString();
string tmpstr = getString();
if (firstline) {
unsigned int i = 0;
while(i < tmpstr.length()
@ -191,14 +191,14 @@ string const LyXLex::getLongString(string const & endtoken)
else // token == endtoken
break;
}
if (!IsOK())
if (!isOK())
printError("Long string not ended by `" + endtoken + '\'');
return str;
}
bool LyXLex::GetBool() const
bool LyXLex::getBool() const
{
if (compare(pimpl_->buff, "true") == 0)
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;
@ -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;

View File

@ -49,7 +49,7 @@ public:
};
/// 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
bool setFile(string const & filename);
///
@ -78,16 +78,16 @@ public:
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'.
This string can span several lines. The first line
@ -99,11 +99,11 @@ public:
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;

View File

@ -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);
}
@ -48,7 +48,7 @@ string const LyXLex::Pimpl::GetString() 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
<< " of file " << MakeDisplayPath(name) << ']' << endl;
}
@ -393,7 +393,7 @@ int LyXLex::Pimpl::lex()
}
bool LyXLex::Pimpl::EatLine()
bool LyXLex::Pimpl::eatLine()
{
int i = 0;
unsigned char c = '\0';

View File

@ -24,7 +24,7 @@ struct LyXLex::Pimpl : boost::noncopyable {
///
Pimpl(keyword_item * tab, int num);
///
string const GetString() const;
string const getString() const;
///
void printError(string const & message) const;
///
@ -46,7 +46,7 @@ struct LyXLex::Pimpl : boost::noncopyable {
///
int lex();
///
bool EatLine();
bool eatLine();
///
bool nextToken();
///

View File

@ -283,11 +283,11 @@ int LyXRC::read(string const & filename)
lexrc.printTable(lyxerr);
lexrc.setFile(filename);
if (!lexrc.IsOK()) return -2;
if (!lexrc.isOK()) return -2;
lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
while (lexrc.IsOK()) {
while (lexrc.isOK()) {
// By using two switches we take advantage of the compiler
// telling us if we have missed a LyXRCTags element in
// the second switch.
@ -309,7 +309,7 @@ int LyXRC::read(string const & filename)
if (lexrc.next()) {
string const tmp =
LibFileSearch(string(),
lexrc.GetString());
lexrc.getString());
if (read(tmp)) {
lexrc.printError("Error reading "
"included file: "+tmp);
@ -318,7 +318,7 @@ int LyXRC::read(string const & filename)
break;
case RC_BINDFILE: // RVDK_PATCH_5
if (lexrc.next()) {
string const tmp(lexrc.GetString());
string const tmp(lexrc.getString());
if (hasBindFile)
// We are already in the
// "actually read bind file"
@ -334,28 +334,28 @@ int LyXRC::read(string const & filename)
case RC_UIFILE:
if (lexrc.next()) {
ui_file = lexrc.GetString();
ui_file = lexrc.getString();
}
break;
case RC_EXIT_CONFIRMATION:
if (lexrc.next())
exit_confirmation = lexrc.GetBool();
exit_confirmation = lexrc.getBool();
break;
case RC_DISPLAY_SHORTCUTS:
if (lexrc.next())
display_shortcuts = lexrc.GetBool();
display_shortcuts = lexrc.getBool();
break;
case RC_KBMAP:
if (lexrc.next())
use_kbmap = lexrc.GetBool();
use_kbmap = lexrc.getBool();
break;
case RC_KBMAP_PRIMARY:
if (lexrc.next()) {
string const kmap(lexrc.GetString());
string const kmap(lexrc.getString());
if (kmap.empty()) {
// nothing
} else if (!LibFileSearch("kbd", kmap,
@ -368,7 +368,7 @@ int LyXRC::read(string const & filename)
case RC_KBMAP_SECONDARY:
if (lexrc.next()) {
string const kmap(lexrc.GetString());
string const kmap(lexrc.getString());
if (kmap.empty()) {
// nothing
} else if (!LibFileSearch("kbd", kmap,
@ -381,113 +381,113 @@ int LyXRC::read(string const & filename)
case RC_FONT_ENCODING:
if (lexrc.next())
fontenc = lexrc.GetString();
fontenc = lexrc.getString();
break;
case RC_PRINTER:
if (lexrc.next())
printer = lexrc.GetString();
printer = lexrc.getString();
break;
case RC_PRINT_COMMAND:
if (lexrc.next())
print_command = lexrc.GetString();
print_command = lexrc.getString();
break;
case RC_PRINTEVENPAGEFLAG:
if (lexrc.next())
print_evenpage_flag = lexrc.GetString();
print_evenpage_flag = lexrc.getString();
break;
case RC_PRINTODDPAGEFLAG:
if (lexrc.next())
print_oddpage_flag = lexrc.GetString();
print_oddpage_flag = lexrc.getString();
break;
case RC_PRINTPAGERANGEFLAG:
if (lexrc.next())
print_pagerange_flag = lexrc.GetString();
print_pagerange_flag = lexrc.getString();
break;
case RC_PRINTCOPIESFLAG:
if (lexrc.next())
print_copies_flag = lexrc.GetString();
print_copies_flag = lexrc.getString();
break;
case RC_PRINTCOLLCOPIESFLAG:
if (lexrc.next())
print_collcopies_flag = lexrc.GetString();
print_collcopies_flag = lexrc.getString();
break;
case RC_PRINTREVERSEFLAG:
if (lexrc.next())
print_reverse_flag = lexrc.GetString();
print_reverse_flag = lexrc.getString();
break;
case RC_PRINTLANDSCAPEFLAG:
if (lexrc.next())
print_landscape_flag = lexrc.GetString();
print_landscape_flag = lexrc.getString();
break;
case RC_PRINTTOPRINTER:
if (lexrc.next())
print_to_printer = lexrc.GetString();
print_to_printer = lexrc.getString();
break;
case RC_PRINT_ADAPTOUTPUT:
if (lexrc.next())
print_adapt_output = lexrc.GetBool();
print_adapt_output = lexrc.getBool();
break;
case RC_PRINTTOFILE:
if (lexrc.next())
print_to_file = lexrc.GetString();
print_to_file = lexrc.getString();
break;
case RC_PRINTFILEEXTENSION:
if (lexrc.next())
print_file_extension = lexrc.GetString();
print_file_extension = lexrc.getString();
break;
case RC_PRINTEXSTRAOPTIONS:
if (lexrc.next())
print_extra_options = lexrc.GetString();
print_extra_options = lexrc.getString();
break;
case RC_PRINTSPOOL_COMMAND:
if (lexrc.next())
print_spool_command = lexrc.GetString();
print_spool_command = lexrc.getString();
break;
case RC_PRINTSPOOL_PRINTERPREFIX:
if (lexrc.next())
print_spool_printerprefix = lexrc.GetString();
print_spool_printerprefix = lexrc.getString();
break;
case RC_PRINTPAPERDIMENSIONFLAG:
if (lexrc.next())
print_paper_dimension_flag = lexrc.GetString();
print_paper_dimension_flag = lexrc.getString();
break;
case RC_PRINTPAPERFLAG:
if (lexrc.next())
print_paper_flag = lexrc.GetString();
print_paper_flag = lexrc.getString();
break;
case RC_CUSTOM_EXPORT_COMMAND:
if (lexrc.next())
custom_export_command = lexrc.GetString();
custom_export_command = lexrc.getString();
break;
case RC_CUSTOM_EXPORT_FORMAT:
if (lexrc.next())
custom_export_format = lexrc.GetString();
custom_export_format = lexrc.getString();
break;
case RC_DEFAULT_PAPERSIZE:
if (lexrc.next()) {
string const size =
lowercase(lexrc.GetString());
lowercase(lexrc.getString());
if (size == "usletter")
default_papersize =
BufferParams::PAPER_USLETTER;
@ -514,150 +514,150 @@ int LyXRC::read(string const & filename)
case RC_VIEWDVI_PAPEROPTION:
if (lexrc.next())
view_dvi_paper_option = lexrc.GetString();
view_dvi_paper_option = lexrc.getString();
else
view_dvi_paper_option = "";
break;
case RC_PS_COMMAND:
if (lexrc.next())
ps_command = lexrc.GetString();
ps_command = lexrc.getString();
break;
case RC_CHKTEX_COMMAND:
if (lexrc.next())
chktex_command = lexrc.GetString();
chktex_command = lexrc.getString();
break;
case RC_SCREEN_DPI:
if (lexrc.next())
dpi = lexrc.GetInteger();
dpi = lexrc.getInteger();
break;
case RC_SCREEN_ZOOM:
if (lexrc.next())
zoom = lexrc.GetInteger();
zoom = lexrc.getInteger();
break;
case RC_WHEEL_JUMP:
if (lexrc.next())
wheel_jump = lexrc.GetInteger();
wheel_jump = lexrc.getInteger();
break;
case RC_SCREEN_FONT_SIZES:
if (lexrc.next())
font_sizes[LyXFont::SIZE_TINY] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_SCRIPT] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_FOOTNOTE] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_SMALL] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_NORMAL] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_LARGE] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_LARGER] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_LARGEST] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_HUGE] =
lexrc.GetFloat();
lexrc.getFloat();
if (lexrc.next())
font_sizes[LyXFont::SIZE_HUGER] =
lexrc.GetFloat();
lexrc.getFloat();
break;
case RC_SCREEN_FONT_SCALABLE:
if (lexrc.next())
use_scalable_fonts = lexrc.GetBool();
use_scalable_fonts = lexrc.getBool();
break;
case RC_AUTOSAVE:
if (lexrc.next())
autosave = lexrc.GetInteger();
autosave = lexrc.getInteger();
break;
case RC_DOCUMENTPATH:
if (lexrc.next()) {
document_path = ExpandPath(lexrc.GetString());
document_path = ExpandPath(lexrc.getString());
}
break;
case RC_TEMPLATEPATH:
if (lexrc.next())
template_path = ExpandPath(lexrc.GetString());
template_path = ExpandPath(lexrc.getString());
break;
case RC_TEMPDIRPATH:
if (lexrc.next())
tempdir_path = ExpandPath(lexrc.GetString());
tempdir_path = ExpandPath(lexrc.getString());
break;
case RC_USETEMPDIR:
if (lexrc.next())
use_tempdir = lexrc.GetBool();
use_tempdir = lexrc.getBool();
break;
case RC_LASTFILES:
if (lexrc.next())
lastfiles = ExpandPath(lexrc.GetString());
lastfiles = ExpandPath(lexrc.getString());
break;
case RC_NUMLASTFILES:
if (lexrc.next())
num_lastfiles = lexrc.GetInteger();
num_lastfiles = lexrc.getInteger();
break;
case RC_CHECKLASTFILES:
if (lexrc.next())
check_lastfiles = lexrc.GetBool();
check_lastfiles = lexrc.getBool();
break;
case RC_SCREEN_FONT_ROMAN:
if (lexrc.next())
roman_font_name = lexrc.GetString();
roman_font_name = lexrc.getString();
break;
case RC_SCREEN_FONT_SANS:
if (lexrc.next())
sans_font_name = lexrc.GetString();
sans_font_name = lexrc.getString();
break;
case RC_SCREEN_FONT_TYPEWRITER:
if (lexrc.next())
typewriter_font_name = lexrc.GetString();
typewriter_font_name = lexrc.getString();
break;
case RC_SCREEN_FONT_MENU:
if (lexrc.next())
menu_font_name = lexrc.GetString();
menu_font_name = lexrc.getString();
break;
case RC_SCREEN_FONT_POPUP:
if (lexrc.next())
popup_font_name = lexrc.GetString();
popup_font_name = lexrc.getString();
break;
case RC_SCREEN_FONT_ENCODING:
if (lexrc.next()) {
font_norm = lexrc.GetString();
font_norm = lexrc.getString();
set_font_norm_type();
}
break;
case RC_SCREEN_FONT_ENCODING_MENU:
if (lexrc.next())
font_norm_menu = lexrc.GetString();
font_norm_menu = lexrc.getString();
break;
case RC_SET_COLOR:
@ -665,14 +665,14 @@ int LyXRC::read(string const & filename)
string lyx_name, x11_name;
if (lexrc.next()) {
lyx_name = lexrc.GetString();
lyx_name = lexrc.getString();
} else {
lexrc.printError("Missing color tag.");
break;
}
if (lexrc.next()) {
x11_name = lexrc.GetString();
x11_name = lexrc.getString();
} else {
lexrc.printError("Missing color name for color : `$$Token'");
break;
@ -687,7 +687,7 @@ int LyXRC::read(string const & filename)
case RC_AUTOREGIONDELETE:
// Auto region delete defaults to true
if (lexrc.next())
auto_region_delete = lexrc.GetBool();
auto_region_delete = lexrc.getBool();
break;
case RC_BIND:
@ -702,14 +702,14 @@ int LyXRC::read(string const & filename)
string seq, cmd;
if (lexrc.next()) {
seq = lexrc.GetString();
seq = lexrc.getString();
} else {
lexrc.printError("RC_BIND: Missing key sequence");
break;
}
if (lexrc.next(true)) {
cmd = lexrc.GetString();
cmd = lexrc.getString();
} else {
lexrc.printError("RC_BIND: missing command");
break;
@ -738,145 +738,145 @@ int LyXRC::read(string const & filename)
}
case RC_OVERRIDE_X_DEADKEYS:
if (lexrc.next())
override_x_deadkeys = lexrc.GetBool();
override_x_deadkeys = lexrc.getBool();
break;
case RC_SERVERPIPE:
if (lexrc.next())
lyxpipes = ExpandPath(lexrc.GetString());
lyxpipes = ExpandPath(lexrc.getString());
break;
case RC_CURSOR_FOLLOWS_SCROLLBAR:
if (lexrc.next())
cursor_follows_scrollbar = lexrc.GetBool();
cursor_follows_scrollbar = lexrc.getBool();
break;
case RC_ASCIIROFF_COMMAND:
if (lexrc.next())
ascii_roff_command = lexrc.GetString();
ascii_roff_command = lexrc.getString();
break;
case RC_ASCII_LINELEN:
if (lexrc.next())
ascii_linelen = lexrc.GetInteger();
ascii_linelen = lexrc.getInteger();
break;
// Spellchecker settings:
#ifdef USE_PSPELL
case RC_USE_PSPELL:
if (lexrc.next())
use_pspell = lexrc.GetBool();
use_pspell = lexrc.getBool();
break;
#endif
case RC_SPELL_COMMAND:
if (lexrc.next())
isp_command = lexrc.GetString();
isp_command = lexrc.getString();
break;
case RC_ACCEPT_COMPOUND:
if (lexrc.next())
isp_accept_compound = lexrc.GetBool();
isp_accept_compound = lexrc.getBool();
break;
case RC_USE_INP_ENC:
if (lexrc.next())
isp_use_input_encoding = lexrc.GetBool();
isp_use_input_encoding = lexrc.getBool();
break;
case RC_USE_ALT_LANG:
if (lexrc.next())
isp_use_alt_lang = lexrc.GetBool();
isp_use_alt_lang = lexrc.getBool();
break;
case RC_USE_PERS_DICT:
if (lexrc.next())
isp_use_pers_dict = lexrc.GetBool();
isp_use_pers_dict = lexrc.getBool();
break;
case RC_USE_ESC_CHARS:
if (lexrc.next())
isp_use_esc_chars = lexrc.GetBool();
isp_use_esc_chars = lexrc.getBool();
break;
case RC_ALT_LANG:
if (lexrc.next())
isp_alt_lang = lexrc.GetString();
isp_alt_lang = lexrc.getString();
break;
case RC_PERS_DICT:
if (lexrc.next())
isp_pers_dict = lexrc.GetString();
isp_pers_dict = lexrc.getString();
break;
case RC_ESC_CHARS:
if (lexrc.next())
isp_esc_chars = lexrc.GetString();
isp_esc_chars = lexrc.getString();
break;
case RC_MAKE_BACKUP:
if (lexrc.next())
make_backup = lexrc.GetBool();
make_backup = lexrc.getBool();
break;
case RC_BACKUPDIR_PATH:
if (lexrc.next())
backupdir_path = ExpandPath(lexrc.GetString());
backupdir_path = ExpandPath(lexrc.getString());
break;
case RC_DATE_INSERT_FORMAT:
if (lexrc.next())
date_insert_format = lexrc.GetString();
date_insert_format = lexrc.getString();
break;
case RC_LANGUAGE_PACKAGE:
if (lexrc.next())
language_package = lexrc.GetString();
language_package = lexrc.getString();
break;
case RC_LANGUAGE_AUTO_BEGIN:
if (lexrc.next())
language_auto_begin = lexrc.GetBool();
language_auto_begin = lexrc.getBool();
break;
case RC_LANGUAGE_AUTO_END:
if (lexrc.next())
language_auto_end = lexrc.GetBool();
language_auto_end = lexrc.getBool();
break;
case RC_LANGUAGE_GLOBAL_OPTIONS:
if (lexrc.next())
language_global_options = lexrc.GetBool();
language_global_options = lexrc.getBool();
break;
case RC_LANGUAGE_USE_BABEL:
if (lexrc.next())
language_use_babel = lexrc.GetBool();
language_use_babel = lexrc.getBool();
break;
case RC_LANGUAGE_COMMAND_BEGIN:
if (lexrc.next())
language_command_begin = lexrc.GetString();
language_command_begin = lexrc.getString();
break;
case RC_LANGUAGE_COMMAND_END:
if (lexrc.next())
language_command_end = lexrc.GetString();
language_command_end = lexrc.getString();
break;
case RC_LANGUAGE_COMMAND_LOCAL:
if (lexrc.next())
language_command_local = lexrc.GetString();
language_command_local = lexrc.getString();
break;
case RC_RTL_SUPPORT:
if (lexrc.next())
rtl_support = lexrc.GetBool();
rtl_support = lexrc.getBool();
break;
case RC_AUTO_NUMBER:
if (lexrc.next())
auto_number = lexrc.GetBool();
auto_number = lexrc.getBool();
break;
case RC_MARK_FOREIGN_LANGUAGE:
if (lexrc.next())
mark_foreign_language = lexrc.GetBool();
mark_foreign_language = lexrc.getBool();
break;
case RC_SHOW_BANNER:
if (lexrc.next())
show_banner = lexrc.GetBool();
show_banner = lexrc.getBool();
break;
case RC_NEW_ASK_FILENAME:
if (lexrc.next())
new_ask_filename = lexrc.GetBool();
new_ask_filename = lexrc.getBool();
break;
case RC_CONVERTER: {
string from, to, command, flags;
if (lexrc.next())
from = lexrc.GetString();
from = lexrc.getString();
if (lexrc.next())
to = lexrc.GetString();
to = lexrc.getString();
if (lexrc.next())
command = lexrc.GetString();
command = lexrc.getString();
if (lexrc.next())
flags = lexrc.GetString();
flags = lexrc.getString();
if (command.empty() || command == "none")
converters.erase(from, to);
else
@ -886,22 +886,22 @@ int LyXRC::read(string const & filename)
case RC_VIEWER: {
string format, command;
if (lexrc.next())
format = lexrc.GetString();
format = lexrc.getString();
if (lexrc.next())
command = lexrc.GetString();
command = lexrc.getString();
formats.setViewer(format, command);
break;
}
case RC_FORMAT: {
string format, extension, prettyname, shortcut;
if (lexrc.next())
format = lexrc.GetString();
format = lexrc.getString();
if (lexrc.next())
extension = lexrc.GetString();
extension = lexrc.getString();
if (lexrc.next())
prettyname = lexrc.GetString();
prettyname = lexrc.getString();
if (lexrc.next())
shortcut = lexrc.GetString();
shortcut = lexrc.getString();
if (prettyname.empty()) {
if (converters.formatIsUsed(format))
lyxerr << "Can't delete format "
@ -916,12 +916,12 @@ int LyXRC::read(string const & filename)
}
case RC_DEFAULT_LANGUAGE:
if (lexrc.next())
default_language = lexrc.GetString();
default_language = lexrc.getString();
break;
case RC_LABEL_INIT_LENGTH:
if (lexrc.next())
label_init_length = lexrc.GetInteger();
label_init_length = lexrc.getInteger();
break;
case RC_LAST: break; // this is just a dummy

View File

@ -1497,9 +1497,9 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
LyXFont font(LyXFont::ALL_INHERIT);
font.setLanguage(owner_->bufferOwner()->getLanguage());
while (lex.IsOK()) {
while (lex.isOK()) {
lex.nextToken();
string const token = lex.GetString();
string const token = lex.getString();
if (token.empty())
continue;
if (token == "\\layout"

View File

@ -2525,20 +2525,6 @@ LyXText::text_status LyXText::status() 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
// below are identical (this for your known use of parentesis!)
// Now some explanation:
@ -2566,5 +2552,4 @@ void LyXText::status(BufferView * bview, LyXText::text_status st) const
}
}
}
#endif
}

View File

@ -225,7 +225,7 @@ int Trans::Load(LyXLex & lex)
{
bool error = false;
while (lex.IsOK() && !error) {
while (lex.isOK() && !error) {
switch (lex.lex()) {
case KMOD:
{
@ -238,7 +238,7 @@ int Trans::Load(LyXLex & lex)
} else
return -1;
string const keys = lex.GetString();
string const keys = lex.getString();
if (lex.next(true)) {
if (lyxerr.debugging(Debug::KBMAP))
@ -247,7 +247,7 @@ int Trans::Load(LyXLex & lex)
} else
return -1;
tex_accent accent = getkeymod(lex.GetString());
tex_accent accent = getkeymod(lex.getString());
if (accent == TEX_NOACCENT)
return -1;
@ -263,7 +263,7 @@ int Trans::Load(LyXLex & lex)
} else
return -1;
string const allowed = lex.GetString();
string const allowed = lex.getString();
AddDeadkey(accent, keys /*, allowed*/);
#else
AddDeadkey(accent, keys);
@ -340,7 +340,7 @@ int Trans::Load(LyXLex & lex)
}
string allowed;
if (lex.next()) {
allowed = lex.GetString();
allowed = lex.getString();
lyxerr[Debug::KBMAP] << "allowed: "
<< allowed << endl;
} else {
@ -388,7 +388,7 @@ int Trans::Load(LyXLex & lex)
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << "'"
<< endl;
accent = getkeymod(lex.GetString());
accent = getkeymod(lex.getString());
} else
return -1;