Are TextRuns always sorted?

Leo Savernik l.savernik at aon.at
Thu Aug 7 16:05:01 CEST 2003


Hello,

I need a more efficient way to find a text run associated with a given offset 
in a RenderText.

Currently findTextRun does a linear search.

However, I noticed that all runs appear to be saved in ascending order, i. e.:

m_lines[0].m_start <=
m_lines[0].m_start + m_lines[0].m_len <= m_lines[1].m_start <=
m_lines[1].m_start + m_lines[1].m_len <= m_lines[2].m_start <=
m_lines[2].m_start + m_lines[2].m_len <= m_lines[3].m_start <=
etc.

Is this order guaranteed to always meet, or are there possibilities (say, for 
strange bidi configurations) which break it.

mfg
	Leo




More information about the Khtml-devel mailing list