const String& TextCheckingParagraph::text() const
{
    ASSERT(m_checkingRange.isNotNull());
    if (m_text.isEmpty())
        m_text = plainText(paragraphRange());
    return m_text;
}
EphemeralRange TextCheckingParagraph::offsetAsRange() const
{
    ASSERT(m_checkingRange.isNotNull());
    if (m_offsetAsRange.isNull())
        m_offsetAsRange = EphemeralRange(paragraphRange().startPosition(), checkingRange().startPosition());

    return m_offsetAsRange;
}
Beispiel #3
0
PassRefPtr<Range> TextCheckingParagraph::offsetAsRange() const
{
    ASSERT(m_checkingRange);
    if (!m_offsetAsRange)
        m_offsetAsRange = Range::create(paragraphRange()->startContainer()->document(), paragraphRange()->startPosition(), checkingRange()->startPosition());

    return m_offsetAsRange;
}
EphemeralRange TextCheckingParagraph::subrange(int characterOffset, int characterCount) const
{
    ASSERT(m_checkingRange.isNotNull());
    return calculateCharacterSubrange(paragraphRange(), characterOffset, characterCount);
}
int TextCheckingParagraph::rangeLength() const
{
    ASSERT(m_checkingRange.isNotNull());
    return TextIterator::rangeLength(paragraphRange().startPosition(), paragraphRange().endPosition());
}
void TextCheckingParagraph::expandRangeToNextEnd()
{
    ASSERT(m_checkingRange.isNotNull());
    setParagraphRange(EphemeralRange(paragraphRange().startPosition(), endOfParagraph(startOfNextParagraph(createVisiblePosition(paragraphRange().startPosition()))).deepEquivalent()));
    invalidateParagraphRangeValues();
}
Beispiel #7
0
PassRefPtr<Range> TextCheckingParagraph::subrange(int characterOffset, int characterCount) const
{
    ASSERT(m_checkingRange);
    return TextIterator::subrange(paragraphRange().get(), characterOffset, characterCount);
}
Beispiel #8
0
int TextCheckingParagraph::rangeLength() const
{
    ASSERT(m_checkingRange);
    return TextIterator::rangeLength(paragraphRange().get());
}
Beispiel #9
0
void TextCheckingParagraph::expandRangeToNextEnd()
{
    ASSERT(m_checkingRange);
    setEnd(paragraphRange().get(), endOfParagraph(startOfNextParagraph(paragraphRange()->startPosition())));
    invalidateParagraphRangeValues();
}