Lines Matching refs:nStartPos
55 sal_Int32 SAL_CALL BreakIteratorImpl::nextCharacters( const OUString& Text, sal_Int32 nStartPos, in nextCharacters() argument
61 … return LBI->nextCharacters( Text, nStartPos, rLocale, nCharacterIteratorMode, nCount, nDone); in nextCharacters()
64 sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text, sal_Int32 nStartPos… in previousCharacters() argument
70 … return LBI->previousCharacters( Text, nStartPos, rLocale, nCharacterIteratorMode, nCount, nDone); in previousCharacters()
104 Boundary SAL_CALL BreakIteratorImpl::nextWord( const OUString& Text, sal_Int32 nStartPos, in nextWord() argument
108 if( nStartPos < 0 || len == 0 ) in nextWord()
110 else if (nStartPos >= len) in nextWord()
113 result = LBI->nextWord(Text, nStartPos, rLocale, rWordType); in nextWord()
115 nStartPos = skipSpace(Text, result.startPos, len, rWordType, sal_True); in nextWord()
117 if ( nStartPos != result.startPos) { in nextWord()
118 if( nStartPos >= len ) in nextWord()
121 result = LBI->getWordBoundary(Text, nStartPos, rLocale, rWordType, sal_True); in nextWord()
123 if (result.startPos < nStartPos) result.startPos = nStartPos; in nextWord()
134 Boundary SAL_CALL BreakIteratorImpl::previousWord( const OUString& Text, sal_Int32 nStartPos, in previousWord() argument
138 if( nStartPos <= 0 || len == 0 ) { in previousWord()
141 } else if (nStartPos > len) { in previousWord()
146 sal_Int32 nPos = skipSpace(Text, nStartPos, len, rWordType, sal_False); in previousWord()
151 …if (nPos != nStartPos && nPos > 0 && !isCJK(rLocale) && getScriptClass(Text.iterateCodePoints(&nPo… in previousWord()
225 sal_Int32 SAL_CALL BreakIteratorImpl::beginOfSentence( const OUString& Text, sal_Int32 nStartPos, in beginOfSentence() argument
228 if (nStartPos < 0 || nStartPos > Text.getLength()) in beginOfSentence()
231 return LBI->beginOfSentence(Text, nStartPos, rLocale); in beginOfSentence()
234 sal_Int32 SAL_CALL BreakIteratorImpl::endOfSentence( const OUString& Text, sal_Int32 nStartPos, in endOfSentence() argument
237 if (nStartPos < 0 || nStartPos > Text.getLength()) in endOfSentence()
240 return LBI->endOfSentence(Text, nStartPos, rLocale); in endOfSentence()
243 …neBreakResults SAL_CALL BreakIteratorImpl::getLineBreak( const OUString& Text, sal_Int32 nStartPos, in getLineBreak() argument
247 return LBI->getLineBreak(Text, nStartPos, rLocale, nMinBreakPos, hOptions, bOptions); in getLineBreak()
261 static sal_Int32 SAL_CALL iterateCodePoints(const OUString& Text, sal_Int32 &nStartPos, sal_Int32 i… in iterateCodePoints() argument
263 if (nStartPos + inc < 0 || nStartPos + inc >= nLen) { in iterateCodePoints()
265 nStartPos = nStartPos + inc < 0 ? -1 : nLen; in iterateCodePoints()
267 ch = Text.iterateCodePoints(&nStartPos, inc); in iterateCodePoints()
279 ch = (nStartPos < nLen ? Text.iterateCodePoints(&nStartPos, 0) : 0); in iterateCodePoints()
281 return nStartPos; in iterateCodePoints()
286 sal_Int32 nStartPos, sal_Int16 ScriptType ) throw(RuntimeException) in beginOfScript() argument
288 if (nStartPos < 0 || nStartPos >= Text.getLength()) in beginOfScript()
291 if(ScriptType != getScriptClass(Text.iterateCodePoints(&nStartPos, 0))) in beginOfScript()
294 if (nStartPos == 0) return 0; in beginOfScript()
296 … while (iterateCodePoints(Text, nStartPos, -1, ch) >= 0 && ScriptType == getScriptClass(ch)) { in beginOfScript()
297 if (nStartPos == 0) return 0; in beginOfScript()
300 return iterateCodePoints(Text, nStartPos, 1, ch); in beginOfScript()
304 sal_Int32 nStartPos, sal_Int16 ScriptType ) throw(RuntimeException) in endOfScript() argument
306 if (nStartPos < 0 || nStartPos >= Text.getLength()) in endOfScript()
309 if(ScriptType != getScriptClass(Text.iterateCodePoints(&nStartPos, 0))) in endOfScript()
314 while(iterateCodePoints(Text, nStartPos, 1, ch) < strLen ) { in endOfScript()
319 return nStartPos; in endOfScript()
323 sal_Int32 nStartPos, sal_Int16 ScriptType ) throw(RuntimeException) in previousScript() argument
325 if (nStartPos < 0) in previousScript()
327 if (nStartPos > Text.getLength()) in previousScript()
328 nStartPos = Text.getLength(); in previousScript()
330 …sal_Int16 numberOfChange = (ScriptType == getScriptClass(Text.iterateCodePoints(&nStartPos, 0))) ?… in previousScript()
333 while (numberOfChange > 0 && iterateCodePoints(Text, nStartPos, -1, ch) >= 0) { in previousScript()
336 else if (nStartPos == 0) { in previousScript()
339 if (nStartPos > 0) in previousScript()
340 Text.iterateCodePoints(&nStartPos, -1); in previousScript()
345 return numberOfChange == 0 ? iterateCodePoints(Text, nStartPos, 1, ch) : -1; in previousScript()
348 sal_Int32 SAL_CALL BreakIteratorImpl::nextScript( const OUString& Text, sal_Int32 nStartPos, in nextScript() argument
352 if (nStartPos < 0) in nextScript()
353 nStartPos = 0; in nextScript()
355 if (nStartPos > strLen) in nextScript()
358 …sal_Int16 numberOfChange = (ScriptType == getScriptClass(Text.iterateCodePoints(&nStartPos, 0))) ?… in nextScript()
361 while (numberOfChange > 0 && iterateCodePoints(Text, nStartPos, 1, ch) < strLen) { in nextScript()
367 return numberOfChange == 0 ? nStartPos : -1; in nextScript()
370 sal_Int32 SAL_CALL BreakIteratorImpl::beginOfCharBlock( const OUString& Text, sal_Int32 nStartPos, in beginOfCharBlock() argument
374 if (nStartPos < 0 || nStartPos >= Text.getLength()) return -1; in beginOfCharBlock()
375 if (CharType != (sal_Int16)u_charType( Text.iterateCodePoints(&nStartPos, 0))) return -1; in beginOfCharBlock()
377 sal_Int32 nPos=nStartPos; in beginOfCharBlock()
378 …while(nStartPos > 0 && CharType == (sal_Int16)u_charType(Text.iterateCodePoints(&nPos, -1))) { nSt… in beginOfCharBlock()
379 return nStartPos; // begin of char block is inclusive in beginOfCharBlock()
382 sal_Int32 SAL_CALL BreakIteratorImpl::endOfCharBlock( const OUString& Text, sal_Int32 nStartPos, in endOfCharBlock() argument
388 if (nStartPos < 0 || nStartPos >= strLen) return -1; in endOfCharBlock()
389 if (CharType != (sal_Int16)u_charType(Text.iterateCodePoints(&nStartPos, 0))) return -1; in endOfCharBlock()
392 …while(iterateCodePoints(Text, nStartPos, 1, ch) < strLen && CharType == (sal_Int16)u_charType(ch))… in endOfCharBlock()
393 return nStartPos; // end of char block is exclusive in endOfCharBlock()
396 sal_Int32 SAL_CALL BreakIteratorImpl::nextCharBlock( const OUString& Text, sal_Int32 nStartPos, in nextCharBlock() argument
400 if (nStartPos < 0 || nStartPos >= Text.getLength()) return -1; in nextCharBlock()
402 …umberOfChange = (CharType == (sal_Int16)u_charType(Text.iterateCodePoints(&nStartPos, 0))) ? 2 : 1; in nextCharBlock()
406 while (numberOfChange > 0 && iterateCodePoints(Text, nStartPos, 1, ch) < strLen) { in nextCharBlock()
410 return numberOfChange == 0 ? nStartPos : -1; in nextCharBlock()
413 sal_Int32 SAL_CALL BreakIteratorImpl::previousCharBlock( const OUString& Text, sal_Int32 nStartPos, in previousCharBlock() argument
417 if (nStartPos < 0 || nStartPos >= Text.getLength()) return -1; in previousCharBlock()
419 …umberOfChange = (CharType == (sal_Int16)u_charType(Text.iterateCodePoints(&nStartPos, 0))) ? 3 : 2; in previousCharBlock()
422 while (numberOfChange > 0 && iterateCodePoints(Text, nStartPos, -1, ch) >= 0) { in previousCharBlock()
425 if (nStartPos == 0 && numberOfChange > 0) { in previousCharBlock()
427 if (numberOfChange == 0) return nStartPos; in previousCharBlock()
430 return numberOfChange == 0 ? iterateCodePoints(Text, nStartPos, 1, ch) : -1; in previousCharBlock()