+ string const token = lex.getString();
+ lyxerr[Debug::INFO] << "Token: " << token << endl;
+
+ if (token.empty())
+ continue;
+ else if (token == "\\end_inset") {
+ finished = true;
+ } else if (token == "file") {
+ if (lex.next()) {
+ string const name = lex.getString();
+ string const path = buf->filePath();
+ params.filename = MakeAbsPath(name, path);
+ }
+ } else if (token == "extra") {
+ if (lex.next());
+ // kept for backwards compability. Delete in 0.13.x
+ } else if (token == "subcaption") {
+ if (lex.eatLine())
+ params.subcaptionText = lex.getString();
+ params.subcaption = true;
+ } else if (token == "label") {
+ if (lex.next());
+ // kept for backwards compability. Delete in 0.13.x
+ } else if (token == "angle") {
+ if (lex.next())
+ params.rotate = true;
+ params.rotateAngle = lex.getFloat();
+ } else if (token == "size") {
+ if (lex.next())
+ params.lyxwidth = LyXLength(lex.getString()+"pt");
+ if (lex.next())
+ params.lyxheight = LyXLength(lex.getString()+"pt");
+ } else if (token == "flags") {
+ if (lex.next())
+ switch (lex.getInteger()) {
+ case 1: params.display = InsetGraphicsParams::MONOCHROME;
+ break;
+ case 2: params.display = InsetGraphicsParams::GRAYSCALE;
+ break;
+ case 3: params.display = InsetGraphicsParams::COLOR;
+ break;
+ }
+ } else if (token == "subfigure") {
+ params.subcaption = true;
+ } else if (token == "width") {
+ if (lex.next()) {
+ int i = lex.getInteger();
+ if (lex.next()) {
+ if (i == 5) {
+ params.scale = lex.getInteger();
+ params.size_type = InsetGraphicsParams::SCALE;
+ } else {
+ params.width = LyXLength(lex.getString()+oldUnits[i]);
+ params.size_type = InsetGraphicsParams::WH;
+ }
+ }
+ }
+ } else if (token == "height") {
+ if (lex.next()) {
+ int i = lex.getInteger();
+ if (lex.next()) {
+ params.height = LyXLength(lex.getString()+oldUnits[i]);
+ params.size_type = InsetGraphicsParams::WH;
+ }
+ }
+ }