本文整理汇总了C++中DocIterator::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ DocIterator::push_back方法的具体用法?C++ DocIterator::push_back怎么用?C++ DocIterator::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocIterator
的用法示例。
在下文中一共展示了DocIterator::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addToToc
void InsetText::addToToc(DocIterator const & cdit, bool output_active,
UpdateType utype, TocBackend & backend) const
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
iterateForToc(dit, output_active, utype, backend);
}
示例2: addToToc
void InsetBranch::addToToc(DocIterator const & cpit) const
{
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetBranch &>(*this)));
Toc & toc = buffer().tocBackend().toc("branch");
docstring str = params_.branch + ": ";
text().forToc(str, TOC_ENTRY_LENGTH);
toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetCollapsable::addToToc(cpit);
}
示例3: addToToc
void InsetNote::addToToc(DocIterator const & cpit) const
{
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetNote &>(*this)));
Toc & toc = buffer().tocBackend().toc("note");
InsetLayout const & il = getLayout();
docstring str = translateIfPossible(il.labelstring()) + from_ascii(": ");
text().forToc(str, TOC_ENTRY_LENGTH);
toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetCollapsable::addToToc(cpit);
}
示例4: addToToc
void InsetText::addToToc(DocIterator const & cdit) const
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
Toc & toc = buffer().tocBackend().toc("tableofcontents");
BufferParams const & bufparams = buffer_->params();
int const min_toclevel = bufparams.documentClass().min_toclevel();
// For each paragraph, traverse its insets and let them add
// their toc items
ParagraphList const & pars = paragraphs();
pit_type pend = paragraphs().size();
for (pit_type pit = 0; pit != pend; ++pit) {
Paragraph const & par = pars[pit];
dit.pit() = pit;
// if we find an optarg, we'll save it for use later.
InsetText const * arginset = 0;
InsetList::const_iterator it = par.insetList().begin();
InsetList::const_iterator end = par.insetList().end();
for (; it != end; ++it) {
Inset & inset = *it->inset;
dit.pos() = it->pos;
//lyxerr << (void*)&inset << " code: " << inset.lyxCode() << std::endl;
inset.addToToc(dit);
if (inset.lyxCode() == ARG_CODE)
arginset = inset.asInsetText();
}
// now the toc entry for the paragraph
int const toclevel = par.layout().toclevel;
if (toclevel != Layout::NOT_IN_TOC && toclevel >= min_toclevel) {
// insert this into the table of contents
docstring tocstring;
if (arginset) {
tocstring = par.labelString();
if (!tocstring.empty())
tocstring += ' ';
arginset->text().forToc(tocstring, TOC_ENTRY_LENGTH);
} else
par.forToc(tocstring, TOC_ENTRY_LENGTH);
dit.pos() = 0;
toc.push_back(TocItem(dit, toclevel - min_toclevel,
tocstring, tocstring));
}
// And now the list of changes.
par.addChangesToToc(dit, buffer());
}
}
示例5: addToToc
void InsetCaptionable::addToToc(DocIterator const & cpit, bool output_active,
UpdateType utype, TocBackend & backend) const
{
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetCaptionable &>(*this)));
docstring str;
// Leave str empty if we generate for output (e.g. xhtml lists of figures).
// This ensures that there is a caption if and only if the string is
// non-empty.
if (utype != OutputUpdate)
text().forOutliner(str, TOC_ENTRY_LENGTH);
TocBuilder & b = backend.builder(caption_type_);
b.pushItem(pit, str, output_active);
// Proceed with the rest of the inset.
InsetCollapsible::addToToc(cpit, output_active, utype, backend);
b.pop();
}
示例6: addToToc
void InsetCaption::addToToc(DocIterator const & cpit, bool output_active) const
{
if (floattype_.empty())
return;
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetCaption &>(*this)));
Toc & toc = buffer().tocBackend().toc(floattype_);
docstring str = full_label_;
int length = output_active ? INT_MAX : TOC_ENTRY_LENGTH;
text().forToc(str, length);
toc.push_back(TocItem(pit, 0, str, output_active));
// Proceed with the rest of the inset.
InsetText::addToToc(cpit, output_active);
}
示例7: addToToc
void InsetCaption::addToToc(DocIterator const & cpit, bool output_active,
UpdateType utype, TocBackend & backend) const
{
string const & type = floattype_.empty() ? "senseless" : floattype_;
DocIterator pit = cpit;
pit.push_back(CursorSlice(const_cast<InsetCaption &>(*this)));
int length = (utype == OutputUpdate) ?
// For output (e.g. xhtml) all (bug #8603) or nothing
(output_active ? INT_MAX : 0) :
// TOC for LyX interface
TOC_ENTRY_LENGTH;
docstring str;
if (length > 0) {
str = full_label_;
text().forOutliner(str, length);
}
backend.builder(type).captionItem(pit, str, output_active);
// Proceed with the rest of the inset.
InsetText::addToToc(cpit, output_active, utype, backend);
}
示例8: addToToc
void InsetText::addToToc(DocIterator const & cdit, bool output_active) const
{
DocIterator dit = cdit;
dit.push_back(CursorSlice(const_cast<InsetText &>(*this)));
iterateForToc(dit, output_active);
}