// character styles
InsetIterator const i_end = inset_iterator_end(in);
for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
- InsetCollapsable * inset = it->asInsetCollapsable();
- if (!inset)
- continue;
- if (inset->lyxCode() != FLEX_CODE)
+ if (it->lyxCode() != FLEX_CODE)
// FIXME: Should we verify all InsetCollapsable?
continue;
- if (!inset->undefined())
+ if (!it->undefined())
continue;
// The flex inset is undefined in newtc
docstring const s = bformat(_(
"Flex inset %1$s is "
"undefined because of class "
"conversion from\n%2$s to %3$s"),
- inset->name(), from_utf8(oldtc.name()),
+ it->name(), from_utf8(oldtc.name()),
from_utf8(newtc.name()));
// To warn the user that something had to be done.
errorlist.push_back(ErrorItem(
}
+bool Inset::undefined() const
+{
+ docstring const & n = getLayout().name();
+ return n.empty() || n == DocumentClass::plainInsetLayout().name();
+}
+
+
void Inset::dump() const
{
write(lyxerr);
virtual docstring name() const;
///
virtual InsetLayout const & getLayout() const;
+ /// Is this inset's layout defined in the document's textclass?
+ bool undefined() const;
/// used to toggle insets
/// is the inset open?
/// should this inset be handled like a normal charater
}
-// 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;
-}
-
-
docstring InsetCollapsable::xhtml(odocstream & os, OutputParams const & runparams) const
{
InsetLayout const & il = getLayout();
}
-bool InsetCollapsable::undefined() const
-{
- docstring const & n = getLayout().name();
- return n.empty() || n == DocumentClass::plainInsetLayout().name();
-}
-
-
docstring InsetCollapsable::contextMenu(BufferView const & bv, int x,
int y) const
{
ColorCode backgroundColor() const { return getLayout().bgcolor(); }
///
ColorCode labelColor() const { return getLayout().labelfont().color(); }
- ///
- int docbook(odocstream &, OutputParams const &) const;
/// It will rarely be right to call this from subclasses, due
/// to the fact that it steps counters, etc. Instead, call
/// InsetText::xhtml().
///
virtual bool usePlainLayout() const { return true; }
- /// 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;
///
int InsetText::docbook(odocstream & os, OutputParams const & runparams) const
{
+ ParagraphList::const_iterator const beg = paragraphs().begin();
+
+ if (!undefined())
+ sgml::openTag(os, getLayout().latexname(),
+ beg->getID(buffer(), runparams) + getLayout().latexparam());
+
docbookParagraphs(paragraphs(), buffer(), os, runparams);
+
+ if (!undefined())
+ sgml::closeTag(os, getLayout().latexname());
+
return 0;
}