#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_latex.h"
#include "sgml.h"
#include "TocBackend.h"
///////////////////////////////////////////////////////////////////////
-InsetIndex::InsetIndex(Buffer const & buf, InsetIndexParams const & params)
+InsetIndex::InsetIndex(Buffer * buf, InsetIndexParams const & params)
: InsetCollapsable(buf), params_(params)
{}
int InsetIndex::latex(odocstream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams_in) const
{
+ OutputParams runparams(runparams_in);
+ runparams.inIndexEntry = true;
+
if (buffer().masterBuffer()->params().use_indices && !params_.index.empty()
&& params_.index != "idx") {
os << "\\sindex[";
}
+docstring InsetIndex::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ return docstring();
+}
+
+
bool InsetIndex::showInsetDialog(BufferView * bv) const
{
bv->showDialog("index", params2string(params_),
case LFUN_INSET_MODIFY: {
if (cmd.getArg(0) == "changetype") {
params_.index = from_utf8(cmd.getArg(1));
- setLayout(cur.buffer()->params());
break;
}
InsetIndexParams params;
InsetIndex::string2params(to_utf8(cmd.argument()), params);
params_.index = params.index;
- setLayout(cur.buffer()->params());
break;
}
}
-docstring const InsetIndex::buttonLabel(BufferView const & bv) const
+ColorCode InsetIndex::labelColor() const
{
- docstring s = _("Idx");
- if (decoration() == InsetLayout::CLASSIC)
- return isOpen(bv) ? s : getNewLabel(s);
- else
- return getNewLabel(s);
+ if (params_.index.empty() || params_.index == from_ascii("idx"))
+ return InsetCollapsable::labelColor();
+ // FIXME UNICODE
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.index));
+ if (c == Color_none)
+ c = InsetCollapsable::labelColor();
+ return c;
}
//
///////////////////////////////////////////////////////////////////////
-InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
- : InsetCommand(p, "index_print")
+InsetPrintIndex::InsetPrintIndex(Buffer * buf, InsetCommandParams const & p)
+ : InsetCommand(buf, p, "index_print")
{}
}
+docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const &) const
+{
+ return docstring();
+}
+
} // namespace lyx