break;
}
case LFUN_BRANCH_INVERT:
+ cur.recordUndoInset(this);
params_.inverted = !params_.inverted;
+ // what we really want here is a TOC update, but that means
+ // a full buffer update
+ cur.forceBufferUpdate();
break;
case LFUN_BRANCH_ADD:
lyx::dispatch(FuncRequest(LFUN_BRANCH_ADD, params_.branch));
}
+bool InsetBranch::producesOutput() const
+{
+ return isBranchSelected(false) != params_.inverted;
+}
+
+
void InsetBranch::latex(otexstream & os, OutputParams const & runparams) const
{
- if (isBranchActive())
+ if (producesOutput())
InsetText::latex(os, runparams);
}
int InsetBranch::plaintext(odocstringstream & os,
OutputParams const & runparams, size_t max_length) const
{
- if (!isBranchActive())
+ if (!producesOutput())
return 0;
int len = InsetText::plaintext(os, runparams, max_length);
int InsetBranch::docbook(odocstream & os,
OutputParams const & runparams) const
{
- return isBranchActive() ? InsetText::docbook(os, runparams) : 0;
+ return producesOutput() ? InsetText::docbook(os, runparams) : 0;
}
docstring InsetBranch::xhtml(XHTMLStream & xs, OutputParams const & rp) const
{
- if (isBranchActive()) {
+ if (producesOutput()) {
OutputParams newrp = rp;
newrp.par_begin = 0;
newrp.par_end = text().paragraphs().size();
void InsetBranch::toString(odocstream & os) const
{
- if (isBranchActive())
+ if (producesOutput())
InsetCollapsable::toString(os);
}
void InsetBranch::forOutliner(docstring & os, size_t const maxlen,
bool const shorten) const
{
- if (isBranchActive())
+ if (producesOutput())
InsetCollapsable::forOutliner(os, maxlen, shorten);
}
void InsetBranch::validate(LaTeXFeatures & features) const
{
- if (isBranchActive())
+ if (producesOutput())
InsetCollapsable::validate(features);
}
bool InsetBranch::isMacroScope() const
{
// Its own scope if not selected by buffer
- return !isBranchActive();
+ return !producesOutput();
}
toc->push_back(TocItem(pit, 0, str, output_active));
// Proceed with the rest of the inset.
- bool const doing_output = output_active && isBranchActive();
+ bool const doing_output = output_active && producesOutput();
InsetCollapsable::addToToc(cpit, doing_output, utype);
}