本文整理汇总了C++中paragraphlist::const_iterator::insetList方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::insetList方法的具体用法?C++ const_iterator::insetList怎么用?C++ const_iterator::insetList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paragraphlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::insetList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paragraphs
InsetCaption const * InsetText::getCaptionInset() const
{
ParagraphList::const_iterator pit = paragraphs().begin();
for (; pit != paragraphs().end(); ++pit) {
InsetList::const_iterator it = pit->insetList().begin();
for (; it != pit->insetList().end(); ++it) {
Inset & inset = *it->inset;
if (inset.lyxCode() == CAPTION_CODE) {
InsetCaption const * ins =
static_cast<InsetCaption const *>(it->inset);
return ins;
}
}
}
return 0;
}
示例2: setMacrocontextPositionRecursive
void InsetText::setMacrocontextPositionRecursive(DocIterator const & pos)
{
text_.setMacrocontextPosition(pos);
ParagraphList::const_iterator pit = paragraphs().begin();
ParagraphList::const_iterator pend = paragraphs().end();
for (; pit != pend; ++pit) {
InsetList::const_iterator iit = pit->insetList().begin();
InsetList::const_iterator end = pit->insetList().end();
for (; iit != end; ++iit) {
if (InsetText * txt = iit->inset->asInsetText()) {
DocIterator ppos(pos);
ppos.push_back(CursorSlice(*txt));
iit->inset->asInsetText()->setMacrocontextPositionRecursive(ppos);
}
}
}
}
示例3: addPreview
void InsetText::addPreview(DocIterator const & text_inset_pos,
PreviewLoader & loader) const
{
ParagraphList::const_iterator pit = paragraphs().begin();
ParagraphList::const_iterator pend = paragraphs().end();
int pidx = 0;
DocIterator inset_pos = text_inset_pos;
inset_pos.push_back(CursorSlice(*const_cast<InsetText *>(this)));
for (; pit != pend; ++pit, ++pidx) {
InsetList::const_iterator it = pit->insetList().begin();
InsetList::const_iterator end = pit->insetList().end();
inset_pos.pit() = pidx;
for (; it != end; ++it) {
inset_pos.pos() = it->pos;
it->inset->addPreview(inset_pos, loader);
}
}
}
示例4: getStatus
bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
switch (cmd.action()) {
case LFUN_INSET_DISSOLVE: {
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
|| cmd.getArg(0) == insetName(lyxCode());
bool const one_cell = nargs() == 1;
if (target_inset)
status.setEnabled(!main_inset && one_cell);
return target_inset;
}
case LFUN_ARGUMENT_INSERT: {
string const arg = cmd.getArg(0);
if (arg.empty()) {
status.setEnabled(false);
return true;
}
if (&buffer().inset() == this || !cur.paragraph().layout().args().empty())
return text_.getStatus(cur, cmd, status);
Layout::LaTeXArgMap args = getLayout().args();
Layout::LaTeXArgMap::const_iterator const lait = args.find(arg);
if (lait != args.end()) {
status.setEnabled(true);
ParagraphList::const_iterator pit = paragraphs().begin();
for (; pit != paragraphs().end(); ++pit) {
InsetList::const_iterator it = pit->insetList().begin();
InsetList::const_iterator end = pit->insetList().end();
for (; it != end; ++it) {
if (it->inset->lyxCode() == ARG_CODE) {
InsetArgument const * ins =
static_cast<InsetArgument const *>(it->inset);
if (ins->name() == arg) {
// we have this already
status.setEnabled(false);
return true;
}
}
}
}
} else
status.setEnabled(false);
return true;
}
default:
// Dispatch only to text_ if the cursor is inside
// the text_. It is not for context menus (bug 5797).
bool ret = false;
if (cur.text() == &text_)
ret = text_.getStatus(cur, cmd, status);
if (!ret)
ret = Inset::getStatus(cur, cmd, status);
return ret;
}
}