void InsetBranch::tocString(odocstream & os) const
{
if (isBranchSelected())
- os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
+ InsetCollapsable::tocString(os);
}
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
+#include "sgml.h"
#include "TextClass.h"
#include "frontends/FontMetrics.h"
}
+// FIXME It seems as if it ought to be possible to do this more simply,
+// maybe by calling InsetText::docbook() in the middle there.
+int InsetCollapsable::docbook(odocstream & os, OutputParams const & runparams) const
+{
+ ParagraphList::const_iterator const beg = paragraphs().begin();
+ ParagraphList::const_iterator par = paragraphs().begin();
+ ParagraphList::const_iterator const end = paragraphs().end();
+
+ if (!undefined())
+ sgml::openTag(os, getLayout().latexname(),
+ par->getID(buffer(), runparams) + getLayout().latexparam());
+
+ for (; par != end; ++par) {
+ par->simpleDocBookOnePar(buffer(), os, runparams,
+ outerFont(distance(beg, par),
+ paragraphs()));
+ }
+
+ if (!undefined())
+ sgml::closeTag(os, getLayout().latexname());
+
+ return 0;
+}
+
+
void InsetCollapsable::validate(LaTeXFeatures & features) const
{
string const preamble = getLayout().preamble();
return InsetText::contextMenu(bv, x, y);
}
+void InsetCollapsable::tocString(odocstream & os) const
+{
+ if (!getLayout().isInToc())
+ return;
+ os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
+}
+
+
} // namespace lyx
///
int latex(odocstream &, OutputParams const &) const;
///
+ int docbook(odocstream &, OutputParams const &) const;
+ ///
void validate(LaTeXFeatures &) const;
///
InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
/// Is this inset's layout defined in the document's textclass?
/// May be wrong after textclass change or paste from another document
bool undefined() const;
+ /// the string that is passed to the TOC
+ void tocString(odocstream &) const;
///
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
protected:
#include "Buffer.h"
#include "BufferParams.h"
-#include "LaTeXFeatures.h"
#include "Lexer.h"
-#include "MetricsInfo.h"
-#include "Paragraph.h"
-#include "paragraph_funcs.h"
-#include "sgml.h"
-#include "Text.h"
#include "support/gettext.h"
#include <ostream>
+//#include "support/debug.h"
using namespace std;
namespace lyx {
}
-int InsetFlex::docbook(odocstream & os, OutputParams const & runparams) const
-{
- ParagraphList::const_iterator const beg = paragraphs().begin();
- ParagraphList::const_iterator par = paragraphs().begin();
- ParagraphList::const_iterator const end = paragraphs().end();
-
- if (!undefined())
- sgml::openTag(os, getLayout().latexname(),
- par->getID(buffer(), runparams) + getLayout().latexparam());
-
- for (; par != end; ++par) {
- par->simpleDocBookOnePar(buffer(), os, runparams,
- outerFont(distance(beg, par),
- paragraphs()));
- }
-
- if (!undefined())
- sgml::closeTag(os, getLayout().latexname());
-
- return 0;
-}
-
-
-void InsetFlex::tocString(odocstream & os) const
-{
- os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
-}
-
-
} // namespace lyx
InsetFlex(Buffer const &, std::string const & layoutName);
///
docstring name() const { return from_utf8(name_); }
-
///
docstring editMessage() const;
///
InsetCode lyxCode() const { return FLEX_CODE; }
///
void write(std::ostream &) const;
-
- ///
- int docbook(odocstream &, OutputParams const &) const;
- /// the string that is passed to the TOC
- void tocString(odocstream &) const;
-
/// should paragraph indendation be ommitted in any case?
bool neverIndent() const { return true; }