Kaydet (Commit) d9ac156b authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Michael Stahl

coverity#1038307 Negative loop bound

Change-Id: Ib0ca4fc350d84e25283e261cb9f48b0f6f22e81b
Reviewed-on: https://gerrit.libreoffice.org/4556Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 3f8445b2
......@@ -1893,15 +1893,19 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
size_t nCount = ubidi_countRuns( pBidi, &nError );
int32_t nStart = 0;
int32_t nEnd;
UBiDiLevel nCurrDir;
for ( size_t nIdx = 0; nIdx < nCount; ++nIdx )
/* ubidi_countRuns can return -1 in case of error */
if(nCount > 0)
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
rInfos.push_back( WritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ) );
nStart = nEnd;
int32_t nStart = 0;
int32_t nEnd;
UBiDiLevel nCurrDir;
for ( size_t nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
rInfos.push_back( WritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ) );
nStart = nEnd;
}
}
ubidi_close( pBidi );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment