21 files changed:
void add_toc2(int menu, string const & extra_label,
void add_toc2(int menu, string const & extra_label,
void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
vector<int> & smn, Window win)
void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
vector<int> & smn, Window win)
// Set the tooltip
#if FL_REVISION >= 89
// Set the tooltip
#if FL_REVISION >= 89
- string help = _(lyxaction.helpText(item->action));
+ string const help(_(lyxaction.helpText(item->action)));
fl_set_object_helper(obj, help.c_str());
#else
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
fl_set_object_helper(obj, help.c_str());
#else
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
if (!lexrc.setFile(filename))
return false;
if (!lexrc.setFile(filename))
return false;
int const le = lexrc.lex();
switch (le) {
int const le = lexrc.lex();
switch (le) {
RGBColor col;
if (!lexrc.next()) break;
RGBColor col;
if (!lexrc.next()) break;
- col.r = lexrc.GetInteger();
+ col.r = lexrc.getInteger();
if (!lexrc.next()) break;
if (!lexrc.next()) break;
- col.g = lexrc.GetInteger();
+ col.g = lexrc.getInteger();
if (!lexrc.next()) break;
if (!lexrc.next()) break;
- col.b = lexrc.GetInteger();
+ col.b = lexrc.getInteger();
fl_mapcolor(le, col.r, col.g, col.b);
}
fl_mapcolor(le, col.r, col.g, col.b);
}
switch (lex.lex()) {
case TM_TEMPLATE: {
lex.next();
switch (lex.lex()) {
case TM_TEMPLATE: {
lex.next();
- string temp = lex.GetString();
+ string const temp = lex.getString();
ExternalTemplate & tmp = templates[temp];
tmp.lyxName = temp;
tmp.readTemplate(lex);
ExternalTemplate & tmp = templates[temp];
tmp.lyxName = temp;
tmp.readTemplate(lex);
pushpophelper pph(lex, templateoptiontags, TO_END);
pushpophelper pph(lex, templateoptiontags, TO_END);
switch (lex.lex()) {
case TO_GUINAME:
lex.next(true);
switch (lex.lex()) {
case TO_GUINAME:
lex.next(true);
- guiName = lex.GetString();
+ guiName = lex.getString();
case TO_FILTER:
lex.next(true);
case TO_FILTER:
lex.next(true);
- fileRegExp = lex.GetString();
+ fileRegExp = lex.getString();
break;
case TO_VIEWCMD:
lex.next(true);
break;
case TO_VIEWCMD:
lex.next(true);
- viewCommand = lex.GetString();
+ viewCommand = lex.getString();
// For security reasons, a command may not be empty!
if (viewCommand.empty())
viewCommand = "true";
// For security reasons, a command may not be empty!
if (viewCommand.empty())
viewCommand = "true";
case TO_EDITCMD:
lex.next(true);
case TO_EDITCMD:
lex.next(true);
- editCommand = lex.GetString();
+ editCommand = lex.getString();
// For security reasons, a command may not be empty!
if (editCommand.empty())
editCommand = "true";
// For security reasons, a command may not be empty!
if (editCommand.empty())
editCommand = "true";
case TO_AUTOMATIC:
lex.next();
case TO_AUTOMATIC:
lex.next();
- automaticProduction = lex.GetBool();
+ automaticProduction = lex.getBool();
break;
case TO_FORMAT:
lex.next(true);
break;
case TO_FORMAT:
lex.next(true);
- formats[lex.GetString()].readFormat(lex);
+ formats[lex.getString()].readFormat(lex);
pushpophelper pph(lex, formattags, FO_END);
pushpophelper pph(lex, formattags, FO_END);
switch (lex.lex()) {
case FO_PRODUCT:
lex.next(true);
switch (lex.lex()) {
case FO_PRODUCT:
lex.next(true);
- product = lex.GetString();
+ product = lex.getString();
break;
case FO_UPDATECMD:
lex.next(true);
break;
case FO_UPDATECMD:
lex.next(true);
- updateCommand = lex.GetString();
+ updateCommand = lex.getString();
// For security reasons, a command may not be empty!
if (updateCommand.empty())
updateCommand = "true";
// For security reasons, a command may not be empty!
if (updateCommand.empty())
updateCommand = "true";
case FO_REQUIREMENT:
lex.next(true);
case FO_REQUIREMENT:
lex.next(true);
- requirement = lex.GetString();
+ requirement = lex.getString();
string buf;
bool finished = false;
string buf;
bool finished = false;
- while (lex.IsOK() && !finished) {
+ while (lex.isOK() && !finished) {
- string const token = lex.GetString();
+ string const token = lex.getString();
lyxerr[Debug::INFO] << "Token: " << token << endl;
if (token.empty())
lyxerr[Debug::INFO] << "Token: " << token << endl;
if (token.empty())
finished = true;
} else if (token == "file") {
if (lex.next()) {
finished = true;
} else if (token == "file") {
if (lex.next()) {
- buf = lex.GetString();
- string buf1 = OnlyPath(owner->fileName());
+ buf = lex.getString();
+ string const buf1(OnlyPath(owner->fileName()));
fname = MakeAbsPath(buf, buf1);
changedfname = true;
}
fname = MakeAbsPath(buf, buf1);
changedfname = true;
}
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "subcaption") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "subcaption") {
- if (lex.EatLine())
- subcaption = lex.GetString();
+ if (lex.eatLine())
+ subcaption = lex.getString();
} else if (token == "label") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "angle") {
if (lex.next())
} else if (token == "label") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "angle") {
if (lex.next())
- angle = lex.GetFloat();
+ angle = lex.getFloat();
} else if (token == "size") {
if (lex.next())
} else if (token == "size") {
if (lex.next())
- wid = lex.GetInteger();
+ wid = lex.getInteger();
- hgh = lex.GetInteger();
+ hgh = lex.getInteger();
} else if (token == "flags") {
if (lex.next())
} else if (token == "flags") {
if (lex.next())
- flags = pflags = lex.GetInteger();
+ flags = pflags = lex.getInteger();
} else if (token == "subfigure") {
subfigure = psubfigure = true;
} else if (token == "width") {
int typ = 0;
if (lex.next())
} else if (token == "subfigure") {
subfigure = psubfigure = true;
} else if (token == "width") {
int typ = 0;
if (lex.next())
- typ = lex.GetInteger();
+ typ = lex.getInteger();
switch (typ) {
case DEF: wtype = DEF; break;
case CM: wtype = CM; break;
switch (typ) {
case DEF: wtype = DEF; break;
case CM: wtype = CM; break;
} else if (token == "height") {
int typ = 0;
if (lex.next())
} else if (token == "height") {
int typ = 0;
if (lex.next())
- typ = lex.GetInteger();
+ typ = lex.getInteger();
switch (typ) {
case DEF: htype = DEF; break;
case CM: htype = CM; break;
switch (typ) {
case DEF: htype = DEF; break;
case CM: htype = CM; break;
/// update the inset representation
virtual void update(BufferView *, LyXFont const &, bool = false)
{}
/// update the inset representation
virtual void update(BufferView *, LyXFont const &, bool = false)
{}
-#if 0
- ///
- virtual LyXFont const convertFont(LyXFont const & font) const;
-#endif
/// what appears in the minibuffer when opening
virtual string const editMessage() const;
///
/// what appears in the minibuffer when opening
virtual string const editMessage() const;
///
// This is necessary here because this is written without begin_inset
// This should be changed!!! (Jug)
void InsetBibKey::read(Buffer const *, LyXLex & lex)
// This is necessary here because this is written without begin_inset
// This should be changed!!! (Jug)
void InsetBibKey::read(Buffer const *, LyXLex & lex)
-{
- string token;
-
- if (lex.EatLine()) {
- token = lex.GetString();
+{
+ if (lex.eatLine()) {
+ string const token = lex.getString();
lex.printError("InsetCommand: Parse error: `$$Token'");
lex.printError("InsetCommand: Parse error: `$$Token'");
if (prefixIs(getContents(), key_prefix)) {
int key = strToInt(getContents().substr(key_prefix.length()));
if (prefixIs(getContents(), key_prefix)) {
int key = strToInt(getContents().substr(key_prefix.length()));
void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
{
void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
{
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "collapsed") {
lex.next();
if (token == "collapsed") {
lex.next();
- collapsed_ = lex.GetBool();
+ collapsed_ = lex.getBool();
} else {
lyxerr << "InsetCollapsable::Read: Missing collapsed!"
<< endl;
} else {
lyxerr << "InsetCollapsable::Read: Missing collapsed!"
<< endl;
- if (lex.EatLine()) {
- token = lex.GetString();
+ if (lex.eatLine()) {
+ token = lex.getString();
lex.printError("InsetCommand: Parse error: `$$Token'");
lex.printError("InsetCommand: Parse error: `$$Token'");
+ }
+
+ while (lex.isOK()) {
- token = lex.GetString();
+ token = lex.getString();
if (token == "\\end_inset")
break;
}
if (token == "\\end_inset")
break;
}
void InsetERT::read(Buffer const * buf, LyXLex & lex)
{
bool token_found = false;
void InsetERT::read(Buffer const * buf, LyXLex & lex)
{
bool token_found = false;
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "status") {
lex.next();
if (token == "status") {
lex.next();
- string st;
- if (lex.GetString() == "Inlined")
+ string const tmp_token = lex.getString();
+
+ if (tmp_token == "Inlined") {
- else if (lex.GetString() == "Collapsed")
+ } else if (tmp_token == "Collapsed") {
- else // leave this as default!
+ } else {
+ // leave this as default!
token_found = true;
} else {
lyxerr << "InsetERT::Read: Missing 'status'-tag!"
token_found = true;
} else {
lyxerr << "InsetERT::Read: Missing 'status'-tag!"
// take countermeasures
lex.pushToken(token);
}
}
InsetCollapsable::read(buf, lex);
if (!token_found) {
// take countermeasures
lex.pushToken(token);
}
}
InsetCollapsable::read(buf, lex);
if (!token_found) {
string token;
// Read inset data from lex and store in format
string token;
// Read inset data from lex and store in format
- if (lex.EatLine()) {
- format = lex.GetString();
- } else
+ if (lex.eatLine()) {
+ format = lex.getString();
+ } else {
lex.printError("InsetExternal: Parse error: `$$Token'");
lex.printError("InsetExternal: Parse error: `$$Token'");
+ }
+
+ while (lex.isOK()) {
- token = lex.GetString();
+ token = lex.getString();
if (token == "\\end_inset")
break;
}
if (token == "\\end_inset")
break;
}
void InsetFloat::read(Buffer const * buf, LyXLex & lex)
{
void InsetFloat::read(Buffer const * buf, LyXLex & lex)
{
- string token = lex.GetString();
+ string token = lex.getString();
if (token == "placement") {
lex.next();
if (token == "placement") {
lex.next();
- floatPlacement_ = lex.GetString();
+ floatPlacement_ = lex.getString();
} else {
lyxerr << "InsetFloat::Read: Missing placement!"
<< endl;
} else {
lyxerr << "InsetFloat::Read: Missing placement!"
<< endl;
lex.pushToken(token);
}
lex.next();
lex.pushToken(token);
}
lex.next();
- token = lex.GetString();
+ token = lex.getString();
if (token == "wide") {
lex.next();
if (token == "wide") {
lex.next();
- string const tmptoken = lex.GetString();
+ string const tmptoken = lex.getString();
if (tmptoken == "true")
wide(true);
else
if (tmptoken == "true")
wide(true);
else
- if (lex.EatLine()) {
- float_type = lex.GetString();
+ if (lex.eatLine()) {
+ float_type = lex.getString();
lyxerr << "FloatList::float_type: " << float_type << endl;
} else
lex.printError("InsetFloatList: Parse error: `$$Token'");
lyxerr << "FloatList::float_type: " << float_type << endl;
} else
lex.printError("InsetFloatList: Parse error: `$$Token'");
- token = lex.GetString();
+ token = lex.getString();
if (token == "\\end_inset")
break;
}
if (token == "\\end_inset")
break;
}
void InsetGraphics::read(Buffer const * buf, LyXLex & lex)
{
void InsetGraphics::read(Buffer const * buf, LyXLex & lex)
{
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "Graphics")
readInsetGraphics(buf, lex);
if (token == "Graphics")
readInsetGraphics(buf, lex);
- while (lex.IsOK() && !finished) {
+ while (lex.isOK() && !finished) {
- string const token = lex.GetString();
+ string const token = lex.getString();
lyxerr[Debug::INFO] << "Token: '" << token << '\''
<< std::endl;
lyxerr[Debug::INFO] << "Token: '" << token << '\''
<< std::endl;
finished = true;
} else if (token == "FormatVersion") {
lex.next();
finished = true;
} else if (token == "FormatVersion") {
lex.next();
- int version = lex.GetInteger();
+ int version = lex.getInteger();
if (version > 1)
lyxerr
<< "This document was created with a newer Graphics widget"
if (version > 1)
lyxerr
<< "This document was created with a newer Graphics widget"
- while (lex.IsOK() && !finished) {
+ while (lex.isOK() && !finished) {
- string const token = lex.GetString();
+ string const token = lex.getString();
lyxerr[Debug::INFO] << "Token: " << token << endl;
if (token.empty())
lyxerr[Debug::INFO] << "Token: " << token << endl;
if (token.empty())
finished = true;
} else if (token == "file") {
if (lex.next()) {
finished = true;
} else if (token == "file") {
if (lex.next()) {
- string const name = lex.GetString();
+ string const name = lex.getString();
string const path = OnlyPath(buf->fileName());
params.filename = MakeAbsPath(name, path);
}
string const path = OnlyPath(buf->fileName());
params.filename = MakeAbsPath(name, path);
}
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "subcaption") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "subcaption") {
- if (lex.EatLine())
- params.subcaptionText = lex.GetString();
+ if (lex.eatLine())
+ params.subcaptionText = lex.getString();
} else if (token == "label") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "angle") {
if (lex.next())
} else if (token == "label") {
if (lex.next());
// kept for backwards compability. Delete in 0.13.x
} else if (token == "angle") {
if (lex.next())
- params.rotateAngle = lex.GetFloat();
+ params.rotateAngle = lex.getFloat();
} else if (token == "size") {
// Size of image on screen is ignored in InsetGraphics, just eat
// the input.
} else if (token == "size") {
// Size of image on screen is ignored in InsetGraphics, just eat
// the input.
- if (lex.next())
- lex.GetInteger();
- if (lex.next())
- lex.GetInteger();
+ if (lex.next()) {
+ lex.getInteger();
+ }
+ if (lex.next()) {
+ lex.getInteger();
+ }
} else if (token == "flags") {
InsetGraphicsParams::DisplayType tmp = InsetGraphicsParams::COLOR;
if (lex.next())
} else if (token == "flags") {
InsetGraphicsParams::DisplayType tmp = InsetGraphicsParams::COLOR;
if (lex.next())
- switch (lex.GetInteger()) {
+ switch (lex.getInteger()) {
case 1: tmp = InsetGraphicsParams::MONOCHROME; break;
case 2: tmp = InsetGraphicsParams::GRAYSCALE; break;
}
case 1: tmp = InsetGraphicsParams::MONOCHROME; break;
case 2: tmp = InsetGraphicsParams::GRAYSCALE; break;
}
} else if (token == "subfigure") {
params.subcaption = true;
} else if (token == "width") {
} else if (token == "subfigure") {
params.subcaption = true;
} else if (token == "width") {
- if (lex.next())
- params.widthResize = static_cast<InsetGraphicsParams::Resize>(lex.GetInteger());
- if (lex.next())
- params.widthSize = lex.GetFloat();
+ if (lex.next()) {
+ params.widthResize = static_cast<InsetGraphicsParams::Resize>(lex.getInteger());
+ }
+ if (lex.next()) {
+ params.widthSize = lex.getFloat();
+ }
} else if (token == "height") {
} else if (token == "height") {
- if (lex.next())
- params.heightResize = static_cast<InsetGraphicsParams::Resize>(lex.GetInteger());
- if (lex.next())
- params.heightSize = lex.GetFloat();
+ if (lex.next()) {
+ params.heightResize = static_cast<InsetGraphicsParams::Resize>(lex.getInteger());
+ }
+ if (lex.next()) {
+ params.heightSize = lex.getFloat();
+ }
{
if (token == "filename") {
lex.next();
{
if (token == "filename") {
lex.next();
- filename = lex.GetString();
+ filename = lex.getString();
if (!filename.empty()) {
// Make the filename with absolute directory.
if (!filename.empty()) {
// Make the filename with absolute directory.
}
} else if (token == "display") {
lex.next();
}
} else if (token == "display") {
lex.next();
- string const type = lex.GetString();
+ string const type = lex.getString();
display = displayTranslator.find(type);
} else if (token == "subcaption") {
subcaption = true;
} else if (token == "subcaptionText") {
lex.next();
display = displayTranslator.find(type);
} else if (token == "subcaption") {
subcaption = true;
} else if (token == "subcaptionText") {
lex.next();
- subcaptionText = lex.GetString();
+ subcaptionText = lex.getString();
} else if (token == "widthResize") {
lex.next();
} else if (token == "widthResize") {
lex.next();
- string const token = lex.GetString();
+ string const token = lex.getString();
readResize(this, false, token);
} else if (token == "width") {
lex.next();
readResize(this, false, token);
} else if (token == "width") {
lex.next();
- widthSize = lex.GetFloat();
+ widthSize = lex.getFloat();
} else if (token == "heightResize") {
lex.next();
} else if (token == "heightResize") {
lex.next();
- string const token = lex.GetString();
+ string const token = lex.getString();
readResize(this, true, token);
} else if (token == "height") {
lex.next();
readResize(this, true, token);
} else if (token == "height") {
lex.next();
- heightSize = lex.GetFloat();
+ heightSize = lex.getFloat();
} else if (token == "rotateOrigin") {
lex.next();
} else if (token == "rotateOrigin") {
lex.next();
- string const token = lex.GetString();
+ string const token = lex.getString();
readOrigin(this, token);
} else if (token == "rotateAngle") {
lex.next();
readOrigin(this, token);
} else if (token == "rotateAngle") {
lex.next();
- rotateAngle = lex.GetFloat();
+ rotateAngle = lex.getFloat();
} else {
// If it's none of the above, its not ours.
return false;
} else {
// If it's none of the above, its not ours.
return false;
void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
{
void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
{
- lex.EatLine();
- contents = lex.GetString();
+ lex.eatLine();
+ contents = lex.getString();
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
{
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
{
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "position") {
lex.next();
if (token == "position") {
lex.next();
- pos_ = static_cast<Position>(lex.GetInteger());
+ pos_ = static_cast<Position>(lex.getInteger());
} else {
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
<< endl;
} else {
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
<< endl;
lex.pushToken(token);
}
}
lex.pushToken(token);
}
}
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "inner_position") {
lex.next();
if (token == "inner_position") {
lex.next();
- inner_pos_ = static_cast<InnerPosition>(lex.GetInteger());
+ inner_pos_ = static_cast<InnerPosition>(lex.getInteger());
} else {
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
<< endl;
} else {
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
<< endl;
lex.pushToken(token);
}
}
lex.pushToken(token);
}
}
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "height") {
lex.next();
if (token == "height") {
lex.next();
- height_ = lex.GetString();
+ height_ = lex.getString();
} else {
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
<< endl;
} else {
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
<< endl;
lex.pushToken(token);
}
}
lex.pushToken(token);
}
}
- string const token = lex.GetString();
+ string const token = lex.getString();
if (token == "width") {
lex.next();
if (token == "width") {
lex.next();
- width_ = lex.GetString();
+ width_ = lex.getString();
} else {
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
<< endl;
} else {
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
<< endl;
void InsetQuotes::read(Buffer const *, LyXLex & lex)
{
lex.nextToken();
void InsetQuotes::read(Buffer const *, LyXLex & lex)
{
lex.nextToken();
- parseString(lex.GetString());
+ parseString(lex.getString());
- if (lex.GetString() != "\\end_inset")
+ if (lex.getString() != "\\end_inset") {
lex.printError("Missing \\end_inset at this point");
lex.printError("Missing \\end_inset at this point");
void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
{
lex.nextToken();
void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
{
lex.nextToken();
- string const command = lex.GetString();
+ string const command = lex.getString();
if (command == "\\-")
kind_ = HYPHENATION;
if (command == "\\-")
kind_ = HYPHENATION;
void InsetTabular::read(Buffer const * buf, LyXLex & lex)
{
void InsetTabular::read(Buffer const * buf, LyXLex & lex)
{
- bool const old_format = (lex.GetString() == "\\LyXTable");
+ bool const old_format = (lex.getString() == "\\LyXTable");
//if (tabular)
//delete tabular;
//if (tabular)
//delete tabular;
- string token = lex.GetString();
- while (lex.IsOK() && (token != "\\end_inset")) {
+ string token = lex.getString();
+ while (lex.isOK() && (token != "\\end_inset")) {
- token = lex.GetString();
+ token = lex.getString();
}
if (token != "\\end_inset") {
lex.printError("Missing \\end_inset at this point. "
}
if (token != "\\end_inset") {
lex.printError("Missing \\end_inset at this point. "
- token = lex.GetString();
+ token = lex.getString();
if (token.empty())
continue;
if (token == "\\end_inset") {
if (token.empty())
continue;
if (token == "\\end_inset") {