#include "IndicesList.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
-#include "MetricsInfo.h"
#include "output_latex.h"
#include "output_xhtml.h"
#include "sgml.h"
#include "frontends/alert.h"
#include <ostream>
+#include <algorithm>
using namespace std;
using namespace lyx::support;
subst(spart2, from_ascii("\\"), docstring());
os << ppart;
os << '@';
+ i += count_char(ppart, '\n');
}
docstring const tpart = *it;
os << tpart;
+ i += count_char(tpart, '\n');
if (it2 < levels_plain.end())
++it2;
}
// write the bit that followed "|"
- if (!cmd.empty())
+ if (!cmd.empty()) {
os << "|" << cmd;
+ i += count_char(cmd, '\n');
+ }
os << '}';
return i;
}
void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.getArg(0) == "changetype") {
InsetIndexParams params;
InsetIndex::string2params(to_utf8(cmd.argument()), params);
params_.index = params.index;
+ // what we really want here is a TOC update, but that means
+ // a full buffer update
+ cur.forceBufferUpdate();
break;
}
bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
&& !params_.index.empty()
&& params_.index != "idx")
features.require("splitidx");
+ InsetCollapsable::validate(features);
}
///////////////////////////////////////////////////////////////////////
InsetPrintIndex::InsetPrintIndex(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p, "index_print")
+ : InsetCommand(buf, p)
{}
void InsetPrintIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.argument() == from_ascii("toggle-subindex")) {
}
InsetCommandParams p(INDEX_PRINT_CODE);
// FIXME UNICODE
- InsetCommand::string2params("index_print",
- to_utf8(cmd.argument()), p);
+ InsetCommand::string2params(to_utf8(cmd.argument()), p);
if (p.getCmdName().empty()) {
- cur.noUpdate();
+ cur.noScreenUpdate();
break;
}
setParams(p);
bool InsetPrintIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.argument() == from_ascii("toggle-subindex")) {
} if (cmd.getArg(0) == "index_print"
&& cmd.getArg(1) == "CommandInset") {
InsetCommandParams p(INDEX_PRINT_CODE);
- InsetCommand::string2params("index_print",
- to_utf8(cmd.argument()), p);
+ InsetCommand::string2params(to_utf8(cmd.argument()), p);
if (suffixIs(p.getCmdName(), '*')) {
status.setEnabled(true);
status.setOnOff(false);
}
-int InsetPrintIndex::latex(odocstream & os, OutputParams const &) const
+int InsetPrintIndex::latex(odocstream & os, OutputParams const & runparams_in) const
{
if (!buffer().masterBuffer()->params().use_indices) {
if (getParam("type") == from_ascii("idx"))
os << "\\printindex{}";
return 0;
}
- os << getCommand();
+ OutputParams runparams = runparams_in;
+ os << getCommand(runparams);
return 0;
}