}
+// FIXME This should really be controlled by the TOC level, or
+// something of the sort.
namespace {
const char * counters_to_save[] = {"section", "chapter"};
unsigned int const numcnts = sizeof(counters_to_save)/sizeof(char *);
}
-void InsetMathHull::addToToc(DocIterator const & pit) const
+void InsetMathHull::addToToc(DocIterator const & pit, bool output_active) const
{
if (!buffer_) {
//FIXME: buffer_ should be set at creation for this inset! Problem is
if (!numbered_[row])
continue;
if (label_[row])
- label_[row]->addToToc(pit);
- toc.push_back(TocItem(pit, 0, nicelabel(row)));
+ label_[row]->addToToc(pit, output_active);
+ toc.push_back(TocItem(pit, 0, nicelabel(row), output_active));
}
}
// it would be better to do this elsewhere, but we can't validate in
// InsetMathMatrix and we have no way, outside MathExtern, to know if
// we even have any matrices.
- features.addPreambleSnippet("<style type=\"text/css\">\n"
+ features.addCSSSnippet(
"table.matrix{display: inline-block; vertical-align: middle; text-align:center;}\n"
"table.matrix td{padding: 0.25px;}\n"
"td.ldelim{width: 0.5ex; border: thin solid black; border-right: none;}\n"
- "td.rdelim{width: 0.5ex; border: thin solid black; border-left: none;}\n"
- "</style>");
+ "td.rdelim{width: 0.5ex; border: thin solid black; border-left: none;}");
}
InsetMathGrid::validate(features);
}
InsetMathGrid::addCol(2);
for (row_type row = 0; row < nrows(); ++row) {
idx_type const i = 3 * row + 1;
- if (cell(i).size()) {
+ if (!cell(i).empty()) {
cell(i + 1) = MathData(buffer_, cell(i).begin() + 1, cell(i).end());
cell(i).erase(1, cell(i).size());
}
MathData ar;
if (cur.inMathed() && cur.selection()) {
asArray(grabAndEraseSelection(cur), ar);
- } else if (pos == cur.cell().size()) {
+ } else if (!pos == cur.cell().empty()) {
ar = cur.cell();
lyxerr << "use whole cell: " << ar << endl;
} else {
cur.undispatched();
break;
- case LFUN_BREAK_PARAGRAPH:
+ case LFUN_PARAGRAPH_BREAK:
// just swallow this
break;
if (type_ == hullSimple || type_ == hullEquation) {
cur.recordUndoInset();
bool const align =
- cur.bv().buffer().params().use_amsmath == BufferParams::package_on;
+ cur.bv().buffer().params().use_package("amsmath") == BufferParams::package_on;
mutate(align ? hullAlign : hullEqnArray);
// mutate() may change labels and such.
cur.forceBufferUpdate();
// we never allow this in math, and we want to bind enter
// to another actions in command-alternatives
- case LFUN_BREAK_PARAGRAPH:
+ case LFUN_PARAGRAPH_BREAK:
status.setEnabled(false);
return true;
case LFUN_MATH_MUTATE: {
}
-int InsetMathHull::plaintext(odocstream & os, OutputParams const & op) const
+int InsetMathHull::plaintext(odocstringstream & os,
+ OutputParams const & op, size_t max_length) const
{
// disables ASCII-art for export of equations. See #2275.
if (0 && display()) {
wi << (c == 0 ? "" : "\t") << cell(index(r, c));
// if it's for the TOC, we write just the first line
// and do not include the newline.
- if (op.for_toc)
+ if (op.for_toc || op.for_tooltip || oss.str().size() >= max_length)
break;
wi << "\n";
}
void InsetMathHull::toString(odocstream & os) const
{
- plaintext(os, OutputParams(0));
+ odocstringstream ods;
+ plaintext(ods, OutputParams(0));
+ os << ods.str();
}
}
-docstring InsetMathHull::contextMenuName() const
+string InsetMathHull::contextMenuName() const
{
- return from_ascii("context-math");
+ return "context-math";
}