[Bug 30627] Common operations in richedit are O(N), should be O(log N) or so