private int reinsertExplicitCodes ( int textLength ) { for ( int i = initialTypes . length ; -- i >= 0 ; ) { byte t = initialTypes [ i ] ; if ( t == LRE || t == RLE || t == LRO || t == RLO || t == PDF || t == BN ) { embeddings [ i ] = 0 ; resultTypes [ i ] = t ; resultLevels [ i ] = - 1 ; } else { -- textLength ; embeddings [ i ] = embeddings [ textLength ] ; resultTypes [ i ] = resultTypes [ textLength ] ; resultLevels [ i ] = resultLevels [ textLength ] ; } } // now propagate forward the levels information (could have // propagated backward, the main thing is not to introduce a level // break where one doesn't already exist). if ( resultLevels [ 0 ] == - 1 ) { resultLevels [ 0 ] = paragraphEmbeddingLevel ; } for ( int i = 1 ; i < initialTypes . length ; ++ i ) { if ( resultLevels [ i ] == - 1 ) { resultLevels [ i ] = resultLevels [ i - 1 ] ; } } // Embedding information is for informational purposes only // so need not be adjusted. return initialTypes . length ; }
Reinsert levels information for explicit codes . This is for ease of relating the level information to the original input data . Note that the levels assigned to these codes are arbitrary they re chosen so as to avoid breaking level runs .