}
text_.setCursor(cur.top(), pit, pos);
- cur.clearSelection();
cur.finishUndo();
}
{
LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
-#if 0
-// FIXME: This code does not seem to be necessary anymore
-// Remove for 2.1 if no counter-evidence is found.
+ // See bug #9042, for instance.
if (isPassThru() && lyxCode() != ARG_CODE) {
// Force any new text to latex_language FIXME: This
// should only be necessary in constructor, but new
cur.current_font.setLanguage(latex_language);
cur.real_current_font.setLanguage(latex_language);
}
-#endif
switch (cmd.action()) {
case LFUN_PASTE:
// environment. Standard collapsable insets should not
// redefine this, non-standard ones may call this.
InsetLayout const & il = getLayout();
+ if (il.forceOwnlines())
+ os << breakln;
if (!il.latexname().empty()) {
if (il.latextype() == InsetLayout::COMMAND) {
// FIXME UNICODE
os << breakln;
else
os << safebreakln;
- os << "\\end{" << from_utf8(il.latexname()) << "}\n";
+ os << "\\end{" << from_utf8(il.latexname()) << "}" << breakln;
if (!il.isDisplay())
os.protectSpace(true);
}
}
+ if (il.forceOwnlines())
+ os << breakln;
}
}
-void InsetText::forToc(docstring & os, size_t maxlen) const
+void InsetText::forOutliner(docstring & os, size_t maxlen) const
{
if (!getLayout().isInToc())
return;
- text().forToc(os, maxlen, false);
+ text().forOutliner(os, maxlen, false);
}
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
+ iterateForToc(dit, output_active);
+}
+
+
+void InsetText::iterateForToc(DocIterator const & cdit, bool output_active) const
+{
+ DocIterator dit = cdit;
Toc & toc = buffer().tocBackend().toc("tableofcontents");
BufferParams const & bufparams = buffer_->params();
tocstring = par.labelString();
if (!tocstring.empty())
tocstring += ' ';
- arginset->text().forToc(tocstring, length);
+ arginset->text().forOutliner(tocstring, length);
} else
- par.forToc(tocstring, length);
+ par.forOutliner(tocstring, length);
dit.pos() = 0;
toc.push_back(TocItem(dit, toclevel - min_toclevel,
tocstring, doing_output, tocstring));