本文整理汇总了C++中DocIterator::buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ DocIterator::buffer方法的具体用法?C++ DocIterator::buffer怎么用?C++ DocIterator::buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocIterator
的用法示例。
在下文中一共展示了DocIterator::buffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: equal
static bool equal(DocIterator & o, DocIterator & n)
{
// Explicitly check for this, so we won't call
// Paragraph::getChar for the last pos.
bool const o_lastpos = o.pos() == o.lastpos();
bool const n_lastpos = n.pos() == n.lastpos();
if (o_lastpos || n_lastpos)
return o_lastpos && n_lastpos;
Paragraph const & old_par = o.text()->getPar(o.pit());
Paragraph const & new_par = n.text()->getPar(n.pit());
char_type const c_o = old_par.getChar(o.pos());
char_type const c_n = new_par.getChar(n.pos());
if (c_o != c_n)
return false;
if (old_par.isInset(o.pos())) {
Inset const * i_o = old_par.getInset(o.pos());
Inset const * i_n = new_par.getInset(n.pos());
if (i_o && i_n)
return equal(i_o, i_n);
}
Font fo = old_par.getFontSettings(o.buffer()->params(), o.pos());
Font fn = new_par.getFontSettings(n.buffer()->params(), n.pos());
return fo == fn;
}
示例2: preparePreview
void InsetPreview::preparePreview(DocIterator const & pos) const
{
TexRow texrow;
odocstringstream str;
otexstream os(str, texrow);
OutputParams runparams(&pos.buffer()->params().encoding());
latex(os, runparams);
docstring const snippet = str.str();
preview_->addPreview(snippet, *pos.buffer());
}
示例3: reloadPreview
void InsetPreview::reloadPreview(DocIterator const & pos) const
{
preparePreview(pos);
preview_->startLoading(*pos.buffer());
}
示例4:
bool SpellcheckerWidget::Private::isCurrentBuffer(DocIterator const & cursor) const
{
return start_.buffer() == cursor.buffer();
}