if (it == maPortions.end()) return std::numeric_limits<sal_Int32>::max(); // not found.
return std::distance(maPortions.begin(), it);
}
sal_Int32 TextPortionList::FindPortion(
sal_Int32 nCharPos, sal_Int32& nPortionStart, bool bPreferStartingPortion) const
{ // When nCharPos at portion limit, the left portion is found
sal_Int32 nTmpPos = 0;
sal_Int32 n = maPortions.size(); for (sal_Int32 i = 0; i < n; ++i)
{ const TextPortion& rPortion = *maPortions[i];
nTmpPos = nTmpPos + rPortion.GetLen(); if ( nTmpPos >= nCharPos )
{ // take this one if we don't prefer the starting portion, or if it's the last one if ( ( nTmpPos != nCharPos ) || !bPreferStartingPortion || ( i == n-1 ) )
{
nPortionStart = nTmpPos - rPortion.GetLen(); return i;
}
}
}
OSL_FAIL( "FindPortion: Not found!" ); return n - 1;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.