#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "Text.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "Text.h"
#include "TextMetrics.h"
#include "frontends/FontMetrics.h"
void InsetNewpageParams::read(Lexer & lex)
{
- lex.next();
- string const command = lex.getString();
+ lex.setContext("InsetNewpageParams::read");
+ string token;
+ lex >> token;
- if (command == "newpage")
+ if (token == "newpage")
kind = InsetNewpageParams::NEWPAGE;
- else if (command == "pagebreak")
+ else if (token == "pagebreak")
kind = InsetNewpageParams::PAGEBREAK;
- else if (command == "clearpage")
+ else if (token == "clearpage")
kind = InsetNewpageParams::CLEARPAGE;
- else if (command == "cleardoublepage")
+ else if (token == "cleardoublepage")
kind = InsetNewpageParams::CLEARDOUBLEPAGE;
else
- lex.printError("InsetNewpage: Unknown kind: `$$Token'");
+ lex.printError("Unknown kind");
- string token;
- lex >> token;
- if (!lex)
- return;
- if (token != "\\end_inset")
- lex.printError("Missing \\end_inset at this point. "
- "Read: `$$Token'");
+ lex >> "\\end_inset";
}
InsetNewpageParams params;
string2params(to_utf8(cmd.argument()), params);
status.setOnOff(params_.kind == params.kind);
- } else {
- status.enabled(true);
- }
+ }
+ status.setEnabled(true);
return true;
default:
return Inset::getStatus(cur, cmd, status);