mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 11:08:41 +00:00
adjust
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2429 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a0bf0835e5
commit
8075064372
@ -231,7 +231,6 @@ string const fixlabel(string const & str)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace anon
|
|
||||||
|
|
||||||
|
|
||||||
void add_toc2(int menu, string const & extra_label,
|
void add_toc2(int menu, string const & extra_label,
|
||||||
@ -318,6 +317,7 @@ void add_toc2(int menu, string const & extra_label,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace anon
|
||||||
|
|
||||||
void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
|
||||||
vector<int> & smn, Window win)
|
vector<int> & smn, Window win)
|
||||||
|
@ -392,7 +392,7 @@ void Toolbar::Pimpl::set(bool doingmain)
|
|||||||
|
|
||||||
// Set the tooltip
|
// Set the tooltip
|
||||||
#if FL_REVISION >= 89
|
#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());
|
fl_set_object_helper(obj, help.c_str());
|
||||||
#else
|
#else
|
||||||
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
|
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
|
||||||
|
@ -130,7 +130,7 @@ bool XformsColor::read(string const & filename)
|
|||||||
if (!lexrc.setFile(filename))
|
if (!lexrc.setFile(filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while (lexrc.IsOK()) {
|
while (lexrc.isOK()) {
|
||||||
int const le = lexrc.lex();
|
int const le = lexrc.lex();
|
||||||
|
|
||||||
switch (le) {
|
switch (le) {
|
||||||
@ -145,13 +145,13 @@ bool XformsColor::read(string const & filename)
|
|||||||
RGBColor col;
|
RGBColor col;
|
||||||
|
|
||||||
if (!lexrc.next()) break;
|
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);
|
||||||
}
|
}
|
||||||
|
@ -163,11 +163,11 @@ void ExternalTemplateManager::readTemplates(string const & path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case TM_TEMPLATE: {
|
case TM_TEMPLATE: {
|
||||||
lex.next();
|
lex.next();
|
||||||
string temp = lex.GetString();
|
string const temp = lex.getString();
|
||||||
ExternalTemplate & tmp = templates[temp];
|
ExternalTemplate & tmp = templates[temp];
|
||||||
tmp.lyxName = temp;
|
tmp.lyxName = temp;
|
||||||
tmp.readTemplate(lex);
|
tmp.readTemplate(lex);
|
||||||
@ -208,11 +208,11 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
|
|||||||
|
|
||||||
pushpophelper pph(lex, templateoptiontags, TO_END);
|
pushpophelper pph(lex, templateoptiontags, TO_END);
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case TO_GUINAME:
|
case TO_GUINAME:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
guiName = lex.GetString();
|
guiName = lex.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_HELPTEXT:
|
case TO_HELPTEXT:
|
||||||
@ -221,12 +221,12 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
|
|||||||
|
|
||||||
case TO_FILTER:
|
case TO_FILTER:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
fileRegExp = lex.GetString();
|
fileRegExp = lex.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_VIEWCMD:
|
case TO_VIEWCMD:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
viewCommand = lex.GetString();
|
viewCommand = lex.getString();
|
||||||
// For security reasons, a command may not be empty!
|
// For security reasons, a command may not be empty!
|
||||||
if (viewCommand.empty())
|
if (viewCommand.empty())
|
||||||
viewCommand = "true";
|
viewCommand = "true";
|
||||||
@ -234,7 +234,7 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
|
|||||||
|
|
||||||
case TO_EDITCMD:
|
case TO_EDITCMD:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
editCommand = lex.GetString();
|
editCommand = lex.getString();
|
||||||
// For security reasons, a command may not be empty!
|
// For security reasons, a command may not be empty!
|
||||||
if (editCommand.empty())
|
if (editCommand.empty())
|
||||||
editCommand = "true";
|
editCommand = "true";
|
||||||
@ -242,12 +242,12 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
|
|||||||
|
|
||||||
case TO_AUTOMATIC:
|
case TO_AUTOMATIC:
|
||||||
lex.next();
|
lex.next();
|
||||||
automaticProduction = lex.GetBool();
|
automaticProduction = lex.getBool();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_FORMAT:
|
case TO_FORMAT:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
formats[lex.GetString()].readFormat(lex);
|
formats[lex.getString()].readFormat(lex);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_END:
|
case TO_END:
|
||||||
@ -283,16 +283,16 @@ void ExternalTemplate::FormatTemplate::readFormat(LyXLex & lex)
|
|||||||
|
|
||||||
pushpophelper pph(lex, formattags, FO_END);
|
pushpophelper pph(lex, formattags, FO_END);
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
switch (lex.lex()) {
|
switch (lex.lex()) {
|
||||||
case FO_PRODUCT:
|
case FO_PRODUCT:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
product = lex.GetString();
|
product = lex.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FO_UPDATECMD:
|
case FO_UPDATECMD:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
updateCommand = lex.GetString();
|
updateCommand = lex.getString();
|
||||||
// For security reasons, a command may not be empty!
|
// For security reasons, a command may not be empty!
|
||||||
if (updateCommand.empty())
|
if (updateCommand.empty())
|
||||||
updateCommand = "true";
|
updateCommand = "true";
|
||||||
@ -300,7 +300,7 @@ void ExternalTemplate::FormatTemplate::readFormat(LyXLex & lex)
|
|||||||
|
|
||||||
case FO_REQUIREMENT:
|
case FO_REQUIREMENT:
|
||||||
lex.next(true);
|
lex.next(true);
|
||||||
requirement = lex.GetString();
|
requirement = lex.getString();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FO_PREAMBLE:
|
case FO_PREAMBLE:
|
||||||
|
@ -1074,10 +1074,10 @@ void InsetFig::read(Buffer const *, LyXLex & lex)
|
|||||||
string buf;
|
string buf;
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !finished) {
|
while (lex.isOK() && !finished) {
|
||||||
lex.next();
|
lex.next();
|
||||||
|
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
lyxerr[Debug::INFO] << "Token: " << token << endl;
|
lyxerr[Debug::INFO] << "Token: " << token << endl;
|
||||||
|
|
||||||
if (token.empty())
|
if (token.empty())
|
||||||
@ -1086,8 +1086,8 @@ void InsetFig::read(Buffer const *, LyXLex & lex)
|
|||||||
finished = true;
|
finished = true;
|
||||||
} else if (token == "file") {
|
} else if (token == "file") {
|
||||||
if (lex.next()) {
|
if (lex.next()) {
|
||||||
buf = lex.GetString();
|
buf = lex.getString();
|
||||||
string buf1 = OnlyPath(owner->fileName());
|
string const buf1(OnlyPath(owner->fileName()));
|
||||||
fname = MakeAbsPath(buf, buf1);
|
fname = MakeAbsPath(buf, buf1);
|
||||||
changedfname = true;
|
changedfname = true;
|
||||||
}
|
}
|
||||||
@ -1095,30 +1095,30 @@ void InsetFig::read(Buffer const *, LyXLex & lex)
|
|||||||
if (lex.next());
|
if (lex.next());
|
||||||
// kept for backwards compability. Delete in 0.13.x
|
// kept for backwards compability. Delete in 0.13.x
|
||||||
} else if (token == "subcaption") {
|
} else if (token == "subcaption") {
|
||||||
if (lex.EatLine())
|
if (lex.eatLine())
|
||||||
subcaption = lex.GetString();
|
subcaption = lex.getString();
|
||||||
} else if (token == "label") {
|
} else if (token == "label") {
|
||||||
if (lex.next());
|
if (lex.next());
|
||||||
// kept for backwards compability. Delete in 0.13.x
|
// kept for backwards compability. Delete in 0.13.x
|
||||||
} else if (token == "angle") {
|
} else if (token == "angle") {
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
angle = lex.GetFloat();
|
angle = lex.getFloat();
|
||||||
} else if (token == "size") {
|
} else if (token == "size") {
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
wid = lex.GetInteger();
|
wid = lex.getInteger();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
hgh = lex.GetInteger();
|
hgh = lex.getInteger();
|
||||||
} else if (token == "flags") {
|
} else if (token == "flags") {
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
flags = pflags = lex.GetInteger();
|
flags = pflags = lex.getInteger();
|
||||||
} else if (token == "subfigure") {
|
} else if (token == "subfigure") {
|
||||||
subfigure = psubfigure = true;
|
subfigure = psubfigure = true;
|
||||||
} else if (token == "width") {
|
} else if (token == "width") {
|
||||||
int typ = 0;
|
int typ = 0;
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
typ = lex.GetInteger();
|
typ = lex.getInteger();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
xwid = lex.GetFloat();
|
xwid = lex.getFloat();
|
||||||
switch (typ) {
|
switch (typ) {
|
||||||
case DEF: wtype = DEF; break;
|
case DEF: wtype = DEF; break;
|
||||||
case CM: wtype = CM; break;
|
case CM: wtype = CM; break;
|
||||||
@ -1133,9 +1133,9 @@ void InsetFig::read(Buffer const *, LyXLex & lex)
|
|||||||
} else if (token == "height") {
|
} else if (token == "height") {
|
||||||
int typ = 0;
|
int typ = 0;
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
typ = lex.GetInteger();
|
typ = lex.getInteger();
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
xhgh = lex.GetFloat();
|
xhgh = lex.getFloat();
|
||||||
switch (typ) {
|
switch (typ) {
|
||||||
case DEF: htype = DEF; break;
|
case DEF: htype = DEF; break;
|
||||||
case CM: htype = CM; break;
|
case CM: htype = CM; break;
|
||||||
|
@ -148,10 +148,6 @@ public:
|
|||||||
/// update the inset representation
|
/// update the inset representation
|
||||||
virtual void update(BufferView *, LyXFont const &, bool = false)
|
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
|
/// what appears in the minibuffer when opening
|
||||||
virtual string const editMessage() const;
|
virtual string const editMessage() const;
|
||||||
///
|
///
|
||||||
|
@ -79,14 +79,13 @@ void InsetBibKey::write(Buffer const *, ostream & os) const
|
|||||||
// This is necessary here because this is written without begin_inset
|
// This is necessary here because this is written without begin_inset
|
||||||
// This should be changed!!! (Jug)
|
// This should be changed!!! (Jug)
|
||||||
void InsetBibKey::read(Buffer const *, LyXLex & lex)
|
void InsetBibKey::read(Buffer const *, LyXLex & lex)
|
||||||
{
|
{
|
||||||
string token;
|
if (lex.eatLine()) {
|
||||||
|
string const token = lex.getString();
|
||||||
if (lex.EatLine()) {
|
|
||||||
token = lex.GetString();
|
|
||||||
scanCommand(token);
|
scanCommand(token);
|
||||||
} else
|
} else {
|
||||||
lex.printError("InsetCommand: Parse error: `$$Token'");
|
lex.printError("InsetCommand: Parse error: `$$Token'");
|
||||||
|
}
|
||||||
|
|
||||||
if (prefixIs(getContents(), key_prefix)) {
|
if (prefixIs(getContents(), key_prefix)) {
|
||||||
int key = strToInt(getContents().substr(key_prefix.length()));
|
int key = strToInt(getContents().substr(key_prefix.length()));
|
||||||
|
@ -87,12 +87,12 @@ void InsetCollapsable::write(Buffer const * buf, ostream & os) const
|
|||||||
|
|
||||||
void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
|
void InsetCollapsable::read(Buffer const * buf, LyXLex & lex)
|
||||||
{
|
{
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "collapsed") {
|
if (token == "collapsed") {
|
||||||
lex.next();
|
lex.next();
|
||||||
collapsed_ = lex.GetBool();
|
collapsed_ = lex.getBool();
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetCollapsable::Read: Missing collapsed!"
|
lyxerr << "InsetCollapsable::Read: Missing collapsed!"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
@ -144,14 +144,16 @@ void InsetCommandParams::read(LyXLex & lex)
|
|||||||
{
|
{
|
||||||
string token;
|
string token;
|
||||||
|
|
||||||
if (lex.EatLine()) {
|
if (lex.eatLine()) {
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
scanCommand(token);
|
scanCommand(token);
|
||||||
} else
|
} else {
|
||||||
lex.printError("InsetCommand: Parse error: `$$Token'");
|
lex.printError("InsetCommand: Parse error: `$$Token'");
|
||||||
while (lex.IsOK()) {
|
}
|
||||||
|
|
||||||
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
if (token == "\\end_inset")
|
if (token == "\\end_inset")
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -91,32 +91,37 @@ InsetERT::~InsetERT()
|
|||||||
void InsetERT::read(Buffer const * buf, LyXLex & lex)
|
void InsetERT::read(Buffer const * buf, LyXLex & lex)
|
||||||
{
|
{
|
||||||
bool token_found = false;
|
bool token_found = false;
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "status") {
|
if (token == "status") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string st;
|
string const tmp_token = lex.getString();
|
||||||
if (lex.GetString() == "Inlined")
|
|
||||||
|
if (tmp_token == "Inlined") {
|
||||||
status_ = Inlined;
|
status_ = Inlined;
|
||||||
else if (lex.GetString() == "Collapsed")
|
} else if (tmp_token == "Collapsed") {
|
||||||
status_ = Collapsed;
|
status_ = Collapsed;
|
||||||
else // leave this as default!
|
} else {
|
||||||
|
// leave this as default!
|
||||||
status_ = Open;
|
status_ = Open;
|
||||||
|
}
|
||||||
|
|
||||||
token_found = true;
|
token_found = true;
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetERT::Read: Missing 'status'-tag!"
|
lyxerr << "InsetERT::Read: Missing 'status'-tag!"
|
||||||
<< endl;
|
<< std::endl;
|
||||||
// take countermeasures
|
// take countermeasures
|
||||||
lex.pushToken(token);
|
lex.pushToken(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InsetCollapsable::read(buf, lex);
|
InsetCollapsable::read(buf, lex);
|
||||||
if (!token_found) {
|
if (!token_found) {
|
||||||
if (collapsed_)
|
if (collapsed_) {
|
||||||
status_ = Collapsed;
|
status_ = Collapsed;
|
||||||
else
|
} else {
|
||||||
status_ = Open;
|
status_ = Open;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setButtonLabel();
|
setButtonLabel();
|
||||||
}
|
}
|
||||||
|
@ -97,13 +97,15 @@ void InsetExternal::read(Buffer const *, LyXLex & lex)
|
|||||||
string token;
|
string token;
|
||||||
|
|
||||||
// Read inset data from lex and store in format
|
// Read inset data from lex and store in format
|
||||||
if (lex.EatLine()) {
|
if (lex.eatLine()) {
|
||||||
format = lex.GetString();
|
format = lex.getString();
|
||||||
} else
|
} else {
|
||||||
lex.printError("InsetExternal: Parse error: `$$Token'");
|
lex.printError("InsetExternal: Parse error: `$$Token'");
|
||||||
while (lex.IsOK()) {
|
}
|
||||||
|
|
||||||
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
if (token == "\\end_inset")
|
if (token == "\\end_inset")
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -150,12 +150,12 @@ void InsetFloat::write(Buffer const * buf, ostream & os) const
|
|||||||
|
|
||||||
void InsetFloat::read(Buffer const * buf, LyXLex & lex)
|
void InsetFloat::read(Buffer const * buf, LyXLex & lex)
|
||||||
{
|
{
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string token = lex.GetString();
|
string token = lex.getString();
|
||||||
if (token == "placement") {
|
if (token == "placement") {
|
||||||
lex.next();
|
lex.next();
|
||||||
floatPlacement_ = lex.GetString();
|
floatPlacement_ = lex.getString();
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetFloat::Read: Missing placement!"
|
lyxerr << "InsetFloat::Read: Missing placement!"
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -163,10 +163,10 @@ void InsetFloat::read(Buffer const * buf, LyXLex & lex)
|
|||||||
lex.pushToken(token);
|
lex.pushToken(token);
|
||||||
}
|
}
|
||||||
lex.next();
|
lex.next();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
if (token == "wide") {
|
if (token == "wide") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const tmptoken = lex.GetString();
|
string const tmptoken = lex.getString();
|
||||||
if (tmptoken == "true")
|
if (tmptoken == "true")
|
||||||
wide(true);
|
wide(true);
|
||||||
else
|
else
|
||||||
|
@ -39,14 +39,14 @@ void InsetFloatList::read(Buffer const *, LyXLex & lex)
|
|||||||
{
|
{
|
||||||
string token;
|
string token;
|
||||||
|
|
||||||
if (lex.EatLine()) {
|
if (lex.eatLine()) {
|
||||||
float_type = lex.GetString();
|
float_type = lex.getString();
|
||||||
lyxerr << "FloatList::float_type: " << float_type << endl;
|
lyxerr << "FloatList::float_type: " << float_type << endl;
|
||||||
} else
|
} else
|
||||||
lex.printError("InsetFloatList: Parse error: `$$Token'");
|
lex.printError("InsetFloatList: Parse error: `$$Token'");
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
if (token == "\\end_inset")
|
if (token == "\\end_inset")
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -354,7 +354,7 @@ void InsetGraphics::write(Buffer const * buf, ostream & os) const
|
|||||||
|
|
||||||
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")
|
if (token == "Graphics")
|
||||||
readInsetGraphics(buf, lex);
|
readInsetGraphics(buf, lex);
|
||||||
@ -370,10 +370,10 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
|
|||||||
{
|
{
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !finished) {
|
while (lex.isOK() && !finished) {
|
||||||
lex.next();
|
lex.next();
|
||||||
|
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
lyxerr[Debug::INFO] << "Token: '" << token << '\''
|
lyxerr[Debug::INFO] << "Token: '" << token << '\''
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
|
|||||||
finished = true;
|
finished = true;
|
||||||
} else if (token == "FormatVersion") {
|
} else if (token == "FormatVersion") {
|
||||||
lex.next();
|
lex.next();
|
||||||
int version = lex.GetInteger();
|
int version = lex.getInteger();
|
||||||
if (version > 1)
|
if (version > 1)
|
||||||
lyxerr
|
lyxerr
|
||||||
<< "This document was created with a newer Graphics widget"
|
<< "This document was created with a newer Graphics widget"
|
||||||
@ -405,10 +405,10 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
|
|||||||
{
|
{
|
||||||
bool finished = false;
|
bool finished = false;
|
||||||
|
|
||||||
while (lex.IsOK() && !finished) {
|
while (lex.isOK() && !finished) {
|
||||||
lex.next();
|
lex.next();
|
||||||
|
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
lyxerr[Debug::INFO] << "Token: " << token << endl;
|
lyxerr[Debug::INFO] << "Token: " << token << endl;
|
||||||
|
|
||||||
if (token.empty())
|
if (token.empty())
|
||||||
@ -417,7 +417,7 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
|
|||||||
finished = true;
|
finished = true;
|
||||||
} else if (token == "file") {
|
} else if (token == "file") {
|
||||||
if (lex.next()) {
|
if (lex.next()) {
|
||||||
string const name = lex.GetString();
|
string const name = lex.getString();
|
||||||
string const path = OnlyPath(buf->fileName());
|
string const path = OnlyPath(buf->fileName());
|
||||||
params.filename = MakeAbsPath(name, path);
|
params.filename = MakeAbsPath(name, path);
|
||||||
}
|
}
|
||||||
@ -425,25 +425,27 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
|
|||||||
if (lex.next());
|
if (lex.next());
|
||||||
// kept for backwards compability. Delete in 0.13.x
|
// kept for backwards compability. Delete in 0.13.x
|
||||||
} else if (token == "subcaption") {
|
} else if (token == "subcaption") {
|
||||||
if (lex.EatLine())
|
if (lex.eatLine())
|
||||||
params.subcaptionText = lex.GetString();
|
params.subcaptionText = lex.getString();
|
||||||
} else if (token == "label") {
|
} else if (token == "label") {
|
||||||
if (lex.next());
|
if (lex.next());
|
||||||
// kept for backwards compability. Delete in 0.13.x
|
// kept for backwards compability. Delete in 0.13.x
|
||||||
} else if (token == "angle") {
|
} else if (token == "angle") {
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
params.rotateAngle = lex.GetFloat();
|
params.rotateAngle = lex.getFloat();
|
||||||
} else if (token == "size") {
|
} else if (token == "size") {
|
||||||
// Size of image on screen is ignored in InsetGraphics, just eat
|
// Size of image on screen is ignored in InsetGraphics, just eat
|
||||||
// the input.
|
// the input.
|
||||||
if (lex.next())
|
if (lex.next()) {
|
||||||
lex.GetInteger();
|
lex.getInteger();
|
||||||
if (lex.next())
|
}
|
||||||
lex.GetInteger();
|
if (lex.next()) {
|
||||||
|
lex.getInteger();
|
||||||
|
}
|
||||||
} else if (token == "flags") {
|
} else if (token == "flags") {
|
||||||
InsetGraphicsParams::DisplayType tmp = InsetGraphicsParams::COLOR;
|
InsetGraphicsParams::DisplayType tmp = InsetGraphicsParams::COLOR;
|
||||||
if (lex.next())
|
if (lex.next())
|
||||||
switch (lex.GetInteger()) {
|
switch (lex.getInteger()) {
|
||||||
case 1: tmp = InsetGraphicsParams::MONOCHROME; break;
|
case 1: tmp = InsetGraphicsParams::MONOCHROME; break;
|
||||||
case 2: tmp = InsetGraphicsParams::GRAYSCALE; break;
|
case 2: tmp = InsetGraphicsParams::GRAYSCALE; break;
|
||||||
}
|
}
|
||||||
@ -451,15 +453,19 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
|
|||||||
} else if (token == "subfigure") {
|
} else if (token == "subfigure") {
|
||||||
params.subcaption = true;
|
params.subcaption = true;
|
||||||
} else if (token == "width") {
|
} else if (token == "width") {
|
||||||
if (lex.next())
|
if (lex.next()) {
|
||||||
params.widthResize = static_cast<InsetGraphicsParams::Resize>(lex.GetInteger());
|
params.widthResize = static_cast<InsetGraphicsParams::Resize>(lex.getInteger());
|
||||||
if (lex.next())
|
}
|
||||||
params.widthSize = lex.GetFloat();
|
if (lex.next()) {
|
||||||
|
params.widthSize = lex.getFloat();
|
||||||
|
}
|
||||||
} else if (token == "height") {
|
} else if (token == "height") {
|
||||||
if (lex.next())
|
if (lex.next()) {
|
||||||
params.heightResize = static_cast<InsetGraphicsParams::Resize>(lex.GetInteger());
|
params.heightResize = static_cast<InsetGraphicsParams::Resize>(lex.getInteger());
|
||||||
if (lex.next())
|
}
|
||||||
params.heightSize = lex.GetFloat();
|
if (lex.next()) {
|
||||||
|
params.heightSize = lex.getFloat();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ bool InsetGraphicsParams::Read(Buffer const * buf, LyXLex & lex,
|
|||||||
{
|
{
|
||||||
if (token == "filename") {
|
if (token == "filename") {
|
||||||
lex.next();
|
lex.next();
|
||||||
filename = lex.GetString();
|
filename = lex.getString();
|
||||||
|
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
// Make the filename with absolute directory.
|
// Make the filename with absolute directory.
|
||||||
@ -294,38 +294,38 @@ bool InsetGraphicsParams::Read(Buffer const * buf, LyXLex & lex,
|
|||||||
}
|
}
|
||||||
} else if (token == "display") {
|
} else if (token == "display") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const type = lex.GetString();
|
string const type = lex.getString();
|
||||||
|
|
||||||
display = displayTranslator.find(type);
|
display = displayTranslator.find(type);
|
||||||
} else if (token == "subcaption") {
|
} else if (token == "subcaption") {
|
||||||
subcaption = true;
|
subcaption = true;
|
||||||
} else if (token == "subcaptionText") {
|
} else if (token == "subcaptionText") {
|
||||||
lex.next();
|
lex.next();
|
||||||
subcaptionText = lex.GetString();
|
subcaptionText = lex.getString();
|
||||||
} else if (token == "widthResize") {
|
} else if (token == "widthResize") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
|
|
||||||
readResize(this, false, token);
|
readResize(this, false, token);
|
||||||
} else if (token == "width") {
|
} else if (token == "width") {
|
||||||
lex.next();
|
lex.next();
|
||||||
widthSize = lex.GetFloat();
|
widthSize = lex.getFloat();
|
||||||
} else if (token == "heightResize") {
|
} else if (token == "heightResize") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
|
|
||||||
readResize(this, true, token);
|
readResize(this, true, token);
|
||||||
} else if (token == "height") {
|
} else if (token == "height") {
|
||||||
lex.next();
|
lex.next();
|
||||||
heightSize = lex.GetFloat();
|
heightSize = lex.getFloat();
|
||||||
} else if (token == "rotateOrigin") {
|
} else if (token == "rotateOrigin") {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
|
|
||||||
readOrigin(this, token);
|
readOrigin(this, token);
|
||||||
} else if (token == "rotateAngle") {
|
} else if (token == "rotateAngle") {
|
||||||
lex.next();
|
lex.next();
|
||||||
rotateAngle = lex.GetFloat();
|
rotateAngle = lex.getFloat();
|
||||||
} else {
|
} else {
|
||||||
// If it's none of the above, its not ours.
|
// If it's none of the above, its not ours.
|
||||||
return false;
|
return false;
|
||||||
|
@ -621,8 +621,8 @@ void InsetLatexAccent::write(Buffer const *, ostream & os) const
|
|||||||
|
|
||||||
void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
|
void InsetLatexAccent::read(Buffer const *, LyXLex & lex)
|
||||||
{
|
{
|
||||||
lex.EatLine();
|
lex.eatLine();
|
||||||
contents = lex.GetString();
|
contents = lex.getString();
|
||||||
checkContents();
|
checkContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ void InsetMinipage::write(Buffer const * buf, ostream & os) const
|
|||||||
|
|
||||||
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
||||||
{
|
{
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "position") {
|
if (token == "position") {
|
||||||
lex.next();
|
lex.next();
|
||||||
pos_ = static_cast<Position>(lex.GetInteger());
|
pos_ = static_cast<Position>(lex.getInteger());
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
|
lyxerr << "InsetMinipage::Read: Missing 'position'-tag!"
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -128,12 +128,12 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
|||||||
lex.pushToken(token);
|
lex.pushToken(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "inner_position") {
|
if (token == "inner_position") {
|
||||||
lex.next();
|
lex.next();
|
||||||
inner_pos_ = static_cast<InnerPosition>(lex.GetInteger());
|
inner_pos_ = static_cast<InnerPosition>(lex.getInteger());
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
|
lyxerr << "InsetMinipage::Read: Missing 'inner_position'-tag!"
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -141,12 +141,12 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
|||||||
lex.pushToken(token);
|
lex.pushToken(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "height") {
|
if (token == "height") {
|
||||||
lex.next();
|
lex.next();
|
||||||
height_ = lex.GetString();
|
height_ = lex.getString();
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
|
lyxerr << "InsetMinipage::Read: Missing 'height'-tag!"
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -154,12 +154,12 @@ void InsetMinipage::read(Buffer const * buf, LyXLex & lex)
|
|||||||
lex.pushToken(token);
|
lex.pushToken(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lex.IsOK()) {
|
if (lex.isOK()) {
|
||||||
lex.next();
|
lex.next();
|
||||||
string const token = lex.GetString();
|
string const token = lex.getString();
|
||||||
if (token == "width") {
|
if (token == "width") {
|
||||||
lex.next();
|
lex.next();
|
||||||
width_ = lex.GetString();
|
width_ = lex.getString();
|
||||||
} else {
|
} else {
|
||||||
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
|
lyxerr << "InsetMinipage::Read: Missing 'width'-tag!"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
@ -243,10 +243,11 @@ void InsetQuotes::write(Buffer const *, ostream & os) const
|
|||||||
void InsetQuotes::read(Buffer const *, LyXLex & lex)
|
void InsetQuotes::read(Buffer const *, LyXLex & lex)
|
||||||
{
|
{
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
parseString(lex.GetString());
|
parseString(lex.getString());
|
||||||
lex.next();
|
lex.next();
|
||||||
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ void InsetSpecialChar::write(Buffer const *, ostream & os) const
|
|||||||
void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
|
void InsetSpecialChar::read(Buffer const *, LyXLex & lex)
|
||||||
{
|
{
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string const command = lex.GetString();
|
string const command = lex.getString();
|
||||||
|
|
||||||
if (command == "\\-")
|
if (command == "\\-")
|
||||||
kind_ = HYPHENATION;
|
kind_ = HYPHENATION;
|
||||||
|
@ -178,7 +178,7 @@ void InsetTabular::write(Buffer const * buf, ostream & os) const
|
|||||||
|
|
||||||
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)
|
//if (tabular)
|
||||||
//delete tabular;
|
//delete tabular;
|
||||||
@ -191,10 +191,10 @@ void InsetTabular::read(Buffer const * buf, LyXLex & lex)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
string token = lex.GetString();
|
string token = lex.getString();
|
||||||
while (lex.IsOK() && (token != "\\end_inset")) {
|
while (lex.isOK() && (token != "\\end_inset")) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
}
|
}
|
||||||
if (token != "\\end_inset") {
|
if (token != "\\end_inset") {
|
||||||
lex.printError("Missing \\end_inset at this point. "
|
lex.printError("Missing \\end_inset at this point. "
|
||||||
|
@ -234,9 +234,9 @@ void InsetText::read(Buffer const * buf, LyXLex & lex)
|
|||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
while (lex.IsOK()) {
|
while (lex.isOK()) {
|
||||||
lex.nextToken();
|
lex.nextToken();
|
||||||
token = lex.GetString();
|
token = lex.getString();
|
||||||
if (token.empty())
|
if (token.empty())
|
||||||
continue;
|
continue;
|
||||||
if (token == "\\end_inset") {
|
if (token == "\\end_inset") {
|
||||||
|
Loading…
Reference in New Issue
Block a user