本文整理汇总了C++中VisiblePosition::honorEditableBoundaryAtOrAfter方法的典型用法代码示例。如果您正苦于以下问题:C++ VisiblePosition::honorEditableBoundaryAtOrAfter方法的具体用法?C++ VisiblePosition::honorEditableBoundaryAtOrAfter怎么用?C++ VisiblePosition::honorEditableBoundaryAtOrAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisiblePosition
的用法示例。
在下文中一共展示了VisiblePosition::honorEditableBoundaryAtOrAfter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startOfLine
VisiblePosition startOfLine(const VisiblePosition& c)
{
VisiblePosition visPos = startPositionForLine(c);
if (visPos.isNotNull()) {
// Make sure the start of line is not greater than the given input position. Else use the previous position to
// obtain start of line. This condition happens when the input position is before the space character at the end
// of a soft-wrapped non-editable line. In this scenario, startPositionForLine would incorrectly hand back a position
// greater than the input position. This fix is to account for the discrepancy between lines with webkit-line-break:after-white-space
// style versus lines without that style, which would break before a space by default.
Position p = visPos.deepEquivalent();
if (p.deprecatedEditingOffset() > c.deepEquivalent().deprecatedEditingOffset() && p.node()->isSameNode(c.deepEquivalent().node())) {
visPos = c.previous();
if (visPos.isNull())
return VisiblePosition();
visPos = startPositionForLine(visPos);
}
}
return c.honorEditableBoundaryAtOrAfter(visPos);
}
示例2: previousSentencePosition
VisiblePosition previousSentencePosition(const VisiblePosition &c)
{
VisiblePosition prev = previousBoundary(c, previousSentencePositionBoundary);
return c.honorEditableBoundaryAtOrAfter(prev);
}
示例3: logicalStartOfLine
VisiblePosition logicalStartOfLine(const VisiblePosition& c)
{
VisiblePosition visPos = logicalStartPositionForLine(c);
return c.honorEditableBoundaryAtOrAfter(visPos);
}