default
* InsetNote.h (producesOutput): always return false.
* InsetBranch.h (producesOutput): returns true if the branch is
selected.
* InsetBranch.cpp (updateLabels):
* InsetNote.cpp (updateLabels): remove
* InsetText.cpp (updateLabels): honor producesOutput().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24475
a592a061-630c-0410-9148-
cb99ea01b6c8
/// Is the width forced to some value?
virtual bool hasFixedWidth() const { return false; }
+ /// Is the content of this inset part of the output document?
+ virtual bool producesOutput() const { return true; }
+
/// \return Tool tip for this inset.
/// This default implementation returns an empty string.
virtual docstring toolTip(BufferView const & bv, int x, int y) const;
}
-void InsetBranch::updateLabels(ParIterator const & it)
-{
- if (isBranchSelected())
- InsetCollapsable::updateLabels(it);
- else {
- DocumentClass const & tclass = buffer().params().documentClass();
- Counters savecnt = tclass.counters();
- InsetCollapsable::updateLabels(it);
- tclass.counters() = savecnt;
- }
-}
-
-
int InsetBranch::latex(odocstream & os, OutputParams const & runparams) const
{
return isBranchSelected() ? InsetText::latex(os, runparams) : 0;
\c buffer. This handles the case of child documents.
*/
bool isBranchSelected() const;
+ /*!
+ * Is the content of this inset part of the output document?
+ *
+ * Note that Branch insets are only considered part of the
+ * document when they are selected.
+ */
+ bool producesOutput() const { return isBranchSelected(); }
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///
- void updateLabels(ParIterator const &);
- ///
bool isMacroScope() const;
///
docstring toolTip(BufferView const & bv, int x, int y) const;
}
-void InsetNote::updateLabels(ParIterator const & it)
-{
- DocumentClass const & tclass = buffer().params().documentClass();
- Counters savecnt = tclass.counters();
- InsetCollapsable::updateLabels(it);
- tclass.counters() = savecnt;
-}
-
-
void InsetNote::addToToc(ParConstIterator const & cpit) const
{
ParConstIterator pit = cpit;
DisplayType display() const;
///
bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
+ /*!
+ * Is the content of this inset part of the output document?
+ *
+ * Note that Note insets are not considered part of the
+ * document, even in their 'greyed out' incarnation.
+ */
+ bool producesOutput() const { return false; }
///
void write(std::ostream &) const;
///
void validate(LaTeXFeatures &) const;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
- // Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &);
///
void addToToc(ParConstIterator const &) const;
///
ParIterator it2 = it;
it2.forwardPos();
LASSERT(&it2.inset() == this && it2.pit() == 0, /**/);
- lyx::updateLabels(buffer(), it2);
+ if (producesOutput())
+ lyx::updateLabels(buffer(), it2);
+ else {
+ DocumentClass const & tclass = buffer().params().documentClass();
+ Counters const savecnt = tclass.counters();
+ lyx::updateLabels(buffer(), it2);
+ tclass.counters() = savecnt;
+ }
}